You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Daniel Holmes edited this page Sep 12, 2015
·
1 revision
The oauth2.Client is based on httplib2 and works just as you'd expect it to. The only difference is the first two arguments to the constructor are an instance of oauth2.Consumer and oauth2.Token (oauth2.Token is only needed for three-legged requests).
importoauth2asoauth# Create your consumer with the proper key/secret.consumer=oauth.Consumer(key="your-twitter-consumer-key",
secret="your-twitter-consumer-secret")
# Request token URL for Twitter.request_token_url="https://api.twitter.com/oauth/request_token"# Create our client.client=oauth.Client(consumer)
# The OAuth Client request works just like httplib2 for the most part.resp, content=client.request(request_token_url, "GET")
printrespprintcontent