Created
September 10, 2012 15:47
-
-
Save nolastan/3691669 to your computer and use it in GitHub Desktop.
tr_python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use the py_oauth2 library | |
# https://github.com/liluo/py-oauth2 | |
from py_oauth2 import oauth2 | |
task_rabbit_client = oauth2.Client(TASK_RABBIT_KEY, TASK_RABBIT_SECRET, | |
site='https://taskrabbitdev.com', | |
authorize_url='https://taskrabbitdev.com/api/authorize', | |
token_url='https://taskrabbitdev.com/api/oauth/token', | |
header_format= 'OAuth %s') | |
task_rabbit_access = oauth2.AccessToken(client=task_rabbit_client, token=TASK_RABBIT_ACCESS_TOKEN, header_format= 'OAuth %s') | |
# make requests like: | |
hdrs= {'X-Client-Application': TASK_RABBIT_SECRET} | |
task_rabbit_access.get('/api/v1/tasks', headers=hdrs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment