由于某些原因,当我尝试发布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
发布于 2013-01-21 23:25:17
您搞错了网址;它是https://api.github.com/user/repos
(user
单数,repos
复数),请参阅Repos create documentation。
https://stackoverflow.com/questions/14448885
复制