Skip to content

Instantly share code, notes, and snippets.

@leandroh
Created May 14, 2014 14:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leandroh/e3c829a30072526740a0 to your computer and use it in GitHub Desktop.
Save leandroh/e3c829a30072526740a0 to your computer and use it in GitHub Desktop.
oauth token
import urllib2
url = "http://api.example.com"
req = urllib2.Request(url)
req.add_header("Accept", "application/json")
req.add_header("Content-Type", "application/x-www-form-urlencoded")
req.add_header("Authorization", "Bearer 591768b9-a3ad-443c-a60c-33ccdabb6cce")
res = urllib2.urlopen(req)
print res.read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment