question

prompt2k2 avatar image
prompt2k2 asked

Basic Authentication with token using Python returns 401

Hi,

My Python code is returning an error whenever I call the API, these credentials work fine on the postman, but not on my python, what am I doing wrong?

username = " username@email.com"
password = "MySecretPassword"
token = 'My Personal Token'
headers = { 'X-Authorization' : token }
r = requests . post ( url , auth =( username , password ), headers = headers )


Why am I getting 401?


VRM
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

0 Answers