SyntaxFix
Write A Post
Hire A Developer
Questions
You can also set headers for the entire session:
TOKEN = 'abcd0123' HEADERS = {'Authorization': 'token {}'.format(TOKEN)} with requests.Session() as s: s.headers.update(HEADERS) resp = s.get('http://example.com/')