Skip to content

Instantly share code, notes, and snippets.

@airsoull
Last active August 29, 2015 14:02
Show Gist options
  • Save airsoull/c2ded1972703879f277f to your computer and use it in GitHub Desktop.
Save airsoull/c2ded1972703879f277f to your computer and use it in GitHub Desktop.
Read json api with token python
# pip install requests
import requests
endpoint = 'www.example.com/api/'
headers = {'Authorization': 'Token 86c565fbc8a108386905e9861503652f1b1f616d'}
response = requests.get(endpoint, headers=headers)
print response.json()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment