C2W2:Assignment2

Getting response 401, for API request in assignment as shown here:

Successfully getting the token:

However, when I made request from a WebRequest page https://reqbin.com/
I am getting a successful response:

Hello @gurdial,

I could reproduce your issue when I didn’t specify headers in the requests.get(). Hope it helps

response = requests.get(URL_NEW_RELEASES, get_auth_header(token.get("access_token")))
repsonse.json()
You get this error -->{'error': {'status': 401, 'message': 'No token provided'}}

Instead use headers=get_auth_header(
response = requests.get(URL_NEW_RELEASES, headers=get_auth_header(token.get("access_token")))