Skip to content

Instantly share code, notes, and snippets.

@ElpixZero
Created April 29, 2024 20:38
Show Gist options
  • Save ElpixZero/37143e86803b9254c5fba16846a786a2 to your computer and use it in GitHub Desktop.
Save ElpixZero/37143e86803b9254c5fba16846a786a2 to your computer and use it in GitHub Desktop.
from urllib import request
url = 'http://google.com'
req = request.Request(url)
print(req.__dict__)
# reqDict это собственно это req.__dict__
reqDict = {'_full_url': 'http://google.com', 'fragment': None, 'type': 'http', 'host': 'google.com', 'selector': '', 'headers': {}, 'unredirected_hdrs': {}, '_data': None, '_tunnel_host': None, 'origin_req_host': 'google.com', 'unverifiable': False}
res = request.urlopen(reqDict)
print(res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment