django - Python requests, keep getting 401 error when accessing an API -
I am trying to make a connection on this with the requests. In particular, I was trying to reach the "all applications" endpoint, I still have trouble creating an initial connection.
& gt; & Gt; & Gt; Import request & gt; & Gt; & Gt; & Gt; & Gt; & Gt; Url = "https://manager.gimbal.com/api/applications" & gt; & Gt; & Gt; Header = {... 'authorization': 'token & lt; MyApiKeyIsHere & gt; ', ...' Content Type ':' application / json '...}> gt; & Gt; & Gt; & Gt; & Gt; & Gt; & Gt; & Gt; & Gt; & Gt; & Gt; & Gt; R = requests.get (url, header = header) & gt; & Gt; & Gt; R & lt; Response [401] & gt; I'm a little confused about why I'm not getting an unauthorized connection to the API. If anybody can provide some signals, then it would be very helpful.
It appears that the document value is actually a token, not just token, only tokens. .
Authorization: Try changing token token = my_organization_server_api_key
'authorization': 'token & lt ; MyApiKeyIsHere & gt; ', See with it, and see if it responds properly
' authorization ':' token token = & lt ; MyApiKeyIsHere & gt; ',
Comments
Post a Comment