Skip to content

Instantly share code, notes, and snippets.

@srgist
Created January 11, 2013 19:32
Show Gist options
  • Save srgist/4513313 to your computer and use it in GitHub Desktop.
Save srgist/4513313 to your computer and use it in GitHub Desktop.
PY:URLFetch
form_fields = json.dumps({
"consumer_key": "10919-c09bc8099013395a6bf878ac",
"redirect_uri": "http://saurabh.com",
"email_address": "Albert.Johnson@example.com"
})
url="https://getpocket.com/v3/oauth/request"
#form_data = urllib.urlencode(form_fields)
result = urlfetch.fetch(url=url,
payload=form_fields,
method=urlfetch.POST,
headers={'Content-Type': 'application/json; charset=UTF-8','X-Accept': 'application/json'})
jsondata = json.loads(result.content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment