Skip to content

Instantly share code, notes, and snippets.

@X-Gorn
Forked from scraperdragon/chrome2requests.py
Last active August 21, 2022 01:38
Show Gist options
  • Save X-Gorn/5f8028faedab54abfc173dac947061a8 to your computer and use it in GitHub Desktop.
Save X-Gorn/5f8028faedab54abfc173dac947061a8 to your computer and use it in GitHub Desktop.
Convert Chrome headers to Python's Requests dictionary
dict([['-'.join([x.capitalize() for x in h.partition(':')[0].strip().split('-')]), h.partition(':')[2].strip()] for h in rawheaders.split('\n')])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment