forked from COMU/githubGUI4linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthorization.py
More file actions
22 lines (13 loc) · 501 Bytes
/
Copy pathauthorization.py
File metadata and controls
22 lines (13 loc) · 501 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import urllib2
#from github4linux import *
def getUserData():
uName = 'kullanicininadi'
pWord = 'parola'
userData = "Basic " + (uName + ":" + pWord).encode("base64").rstrip()
req = urllib2.Request('https://api.github.com/users/braitsch')
req.add_header('Accept', 'application/json')
req.add_header("Content-type", "application/x-www-form-urlencoded")
req.add_header('Authorization', userData)
res = urllib2.urlopen(req)
print "authorization"
getUserData()