Skip to content

Instantly share code, notes, and snippets.

@jorisroovers
Created September 30, 2013 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorisroovers/6761730 to your computer and use it in GitHub Desktop.
Save jorisroovers/6761730 to your computer and use it in GitHub Desktop.
payload = {"auth" : {"passwordCredentials" : {"username": username, "password": password}}}
headers = {'content-type': 'application/json'}
r = requests.post(url, data=json.dumps(payload), headers = headers)
result = r.json()
print result["access"]["token"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment