Created
July 14, 2015 17:37
-
-
Save xiongchiamiov/d6a4b3db757b5c7e9fd8 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env python | |
import requests | |
from constants import * | |
auth = requests.auth.HTTPBasicAuth(client_id, client_secret) | |
data = { | |
'grant_type': 'password', | |
'username': username, | |
'password': password, | |
'device_id': 5, | |
'duration': 'permanent', | |
} | |
headers = {'User-Agent': user_agent} | |
r = requests.post('https://reddit.local:8001/api/v1/access_token', | |
auth=auth, data=data, headers=headers, verify=False) | |
print r | |
print r.json() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment