Skip to content

Instantly share code, notes, and snippets.

@danleyb2
Created January 7, 2016 13:49
Show Gist options
  • Save danleyb2/0640044a8cd67e2ff6e4 to your computer and use it in GitHub Desktop.
Save danleyb2/0640044a8cd67e2ff6e4 to your computer and use it in GitHub Desktop.
import requests
import json
url = 'https://api.github.com/some/endpoint'
payload = {'some': 'data'}
# Create your header as required
headers = {"content-type": "application/json", "Authorization": "<auth-key>" }
r = requests.put(url, data=json.dumps(payload), headers=headers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment