Skip to content

Instantly share code, notes, and snippets.

@nikolaygit
Created November 20, 2013 17:49
Show Gist options
  • Save nikolaygit/7567732 to your computer and use it in GitHub Desktop.
Save nikolaygit/7567732 to your computer and use it in GitHub Desktop.
Always defined the Content-Type header: http://docs.python-requests.org/en/latest/index.html
headers = {'Content-type': 'application/json', 'Accept-Charset': 'UTF-8', 'Accept': 'application/json'}
result = requests.post(URL, data=json.dumps(payload), headers=headers, auth=(USER, PASS))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment