From 633fc4269dec8d5f6a1b1e3e8839b1353942f96c Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 14 Sep 2018 13:20:26 +0800 Subject: [PATCH] 1 --- gitlab/githelper.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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')