import urllib.request def httpGet(): req = urllib.request.Request('http://git.kingsome.cn/api/v4/projects') req.add_header('Private-Token', 'cRjSP2EUx1SaQYcis9W7') print(urllib.request.urlopen(req).read()) httpGet()