1
This commit is contained in:
parent
633fc4269d
commit
54426a3a7c
@ -1,9 +1,17 @@
|
||||
import json
|
||||
import urllib.request
|
||||
|
||||
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())
|
||||
data = urllib.request.urlopen(req).readall()
|
||||
return json.loads(data.decode('utf-8'))
|
||||
|
||||
httpGet('http://git.kingsome.cn/api/v4/projects')
|
||||
projects = httpGet('http://git.kingsome.cn/api/v4/projects?',
|
||||
{
|
||||
'page': 1,
|
||||
'per_page': 1000
|
||||
})
|
||||
for proj in projects:
|
||||
print(proj['path_with_namespace'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user