I'm trying to change, or update the authorization for a Python Requests Session. I tried two different ways:
sesh.headers.update({'Authorization': 'Bearer {}'.format(access_tok)})
req = sesh.get('https://website/{}'.format(oureq.get('pmid')), headers ={'Authorization': 'Bearer {}'.format(access_tok)} )
print("Doing guess at get for pmid status code is {}".format(req.status_code))
print("Headers sent {}".format(req.request.headers))
The response is below. NOTICE that the Authorization is not bearer! It is still Basic. What am I doing wrong?
Doing guess at get for pmid status code is 200
Headers sent {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Authorization': 'Basic cGblah4uY29tOktuaWdodDg4IQ==', 'Cookie': 'ARRAffinity=9c41ffc1313blahbluhc393a76feb8848401b3c822cbaeaae362e0316b; ARRAffinitySameSite=9c41ffc131blah6c2a5fbbd9c393a76feb8848401b3c822cbaeaae362e0316b; coid=1482; domain=<down>ia; firstUnitId=195878; locale=en-US; logourl=https://testurl.com/SUCOMR/logo_agency.gif; ophoster=owner; pmid=ff82; pmname=Sumtreats; source=EscVRS; timezone=MST; tld=com; url=https://<website>.com/dffd/; utcoffset=-07'}