This commit is contained in:
aozhiwei 2018-09-14 13:20:26 +08:00
parent 1a04e4765d
commit 633fc4269d

View File

@ -1,8 +1,9 @@
import urllib.request
def httpGet():
req = urllib.request.Request('http://git.kingsome.cn/api/v4/projects')
def httpGet(url, params={}):
real_url = url + urllib.parse.urlencode(params)
req = urllib.request.Request(real_url)
req.add_header('Private-Token', 'cRjSP2EUx1SaQYcis9W7')
print(urllib.request.urlopen(req).read())
httpGet()
httpGet('http://git.kingsome.cn/api/v4/projects')