Skip to content

Instantly share code, notes, and snippets.

@beaumartinez
Created June 1, 2012 09:48
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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