diff --git a/gitlab/githelper.py b/gitlab/githelper.py index b4db3bc..c8d95dd 100644 --- a/gitlab/githelper.py +++ b/gitlab/githelper.py @@ -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')