1

出于某种原因,当我尝试发布 githubs api 来创建存储库时,我不断收到 404 not found。这是我的代码,有其他人经历过吗?

url = "https://api.github.com/users/repo"

headers = {
    "Content-type" : "application/json",
    "Authorization" : "token %s" % self.config['token'],
}

request = urllib2.Request(url, json.dumps(data), headers)

try:
    response = urllib2.urlopen(request).read()
    # print response
except Exception, e:    
    print e
4

1 回答 1

2

你的网址有误;它是https://api.github.com/user/reposuser单数、repos复数),请参阅Repos 创建文档

于 2013-01-21T23:25:17.137 回答