Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python to VB
#1
Hello, this is my first post here. My apologies if this is posted in the wrong place. Are there any .Net programmers here?
I'm trying to convert a python script to VB.net. I have most of it done, but I'm hung up on one part.

This is the line I'm stuck on:

res = ses.get(url, headers=myHeader, timeout=15, verify=False)

This is the header I need to use:

{'User-Agent': 'Mozilla/5.0 (QtEmbedded; U; Linux; C) AppleWebKit/533.3 (KHTML, like Gecko) Mobile Safari/533.3', 'Referer': 'http://myurl.com/c/', 'Accept': 'application/json,application/javascript,text/javascript,text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Encoding': 'gzip, deflate', 'Connection': 'Keep-Alive', 'X-User-Agent': 'Model: ABC123; Link: Ethernet'}

I think I need to use HttpClient in .Net, but I don't know how to add this header. Can I add it as one big string or do I need to break it apart. And how do I handle the timeout & verify parameters? Any help would be much appreciated. Thanks...
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020