I am trying to get an API query into python. The command line
curl --header \"Authorization:access_token myToken\" https://website.com/id
g
I had the same problem when trying to use a token with Github.
The only syntax that has worked for me with Python 3 is:
import requests myToken = '' myUrl = '' head = {'Authorization': 'token {}'.format(myToken)} response = requests.get(myUrl, headers=head)