Python post request with Bearer token Python post request with Bearer token python python

Python post request with Bearer token


import requestsauth_token='kbkcmbkcmbkcbc9ic9vixc9vixc9v'hed = {'Authorization': 'Bearer ' + auth_token}data = {'app' : 'aaaaa'}url = 'https://api.xy.com'response = requests.post(url, json=data, headers=hed)print(response)print(response.json())


You can get the token from response

request.headers['authorization']