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()) httpGet('http://git.kingsome.cn/api/v4/projects')