Skip to content

Instantly share code, notes, and snippets.

@beaumartinez
Created June 1, 2012 09:48
Show Gist options
  • Save beaumartinez/2850836 to your computer and use it in GitHub Desktop.
Save beaumartinez/2850836 to your computer and use it in GitHub Desktop.
requests-oauth demo
import requests
from oauth_hook import OAuthHook
def oauth_session(consumer_key, consumer_secret):
hook = OAuthHook(consumer_key=consumer_key, consumer_secret=consumer_secret)
session = requests.session(hooks={'pre_request': hook})
return session
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment