For some reason, when I try to post githubs api to create a repository, I keep getting a 404 not found. Here’s my code, has anyone else experienced this?
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
You have the URL wrong; it’s
https://api.github.com/user/repos(usersingular,reposplural), see the Repos create documentation.