Code-
HEADER= {
'Authorization': f'Token {TOKEN}'
}
resp= requests.request(
"GET",
url,
headers=HEADER
)
Error message-
{'detail': 'Authentication credentials were not provided.'}
resp.request.headers output
{'User-Agent': 'python-requests/2.28.1', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive'}
I have tried passing HEADER dict directly in request function (with/without fstring)
directly used .get
Basically tried everything mentioned here Python requests library how to pass Authorization header with single token
nothing worked...any idea what might be wrong
TOKEN is correct