Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- snip --
- #print response.text
- j = json.loads(response.text)
- access_token = j['access_token']
- ## Call API
- api_endpoint = "https://s.myd.omain/rs/printHeaders.py"
- h = {'Authorization': 'Bearer %s' % access_token}
- try:
- response = requests.post(api_endpoint, headers=h)
- except AttributeError:
- print ("no such attribute")
- except NameError:
- print ("no such name")
- print response.text
Advertisement
Add Comment
Please, Sign In to add comment