Skip to content

Instantly share code, notes, and snippets.

@Echocage
Created May 2, 2015 23:08
Show Gist options
  • Save Echocage/15c7b94d83a2895e5fd0 to your computer and use it in GitHub Desktop.
Save Echocage/15c7b94d83a2895e5fd0 to your computer and use it in GitHub Desktop.
>>> from requests.auth import HTTPBasicAuth
>>> auth = HTTPBasicAuth('[email protected]', 'not_a_real_password')
>>> r = requests.post(url=url, data=body, auth=auth)
>>> r.status_code
201
>>> content = r.json()
>>> print(content[u'body'])
Sounds great! I'll get right on it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment