-
-
Save X-Gorn/5f8028faedab54abfc173dac947061a8 to your computer and use it in GitHub Desktop.
Convert Chrome headers to Python's Requests dictionary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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