- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrest_api.py
More file actions
Latest commit
13 lines (9 loc) · 423 Bytes
/
Copy pathrest_api.py
File metadata and controls
13 lines (9 loc) · 423 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/python
# http://isbullsh.it/2012/06/Rest-api-in-python/
# https://developer.yahoo.com/python/python-rest.html
# use urllib2
github_url='https://api.github.com/user/repos'
request=urllib2.Request(github_url, urllib.urlencode({'name':'Test repo', 'description': 'Some test repository'})) # Manual encoding required
handler=urllib2.urlopen(request)
handler=urllib2.urlopen(request)
printhandler.read()