当我尝试创建回购协议时,Github Api v3提供404

当我尝试创建回购协议时,Github Api v3提供404,api,github,Api,Github,我已使用相应的响应执行了以下命令。 但是,如果我试图获取有关/user的信息,它会起作用,这意味着我的令牌是有效的 我做错了什么 guto@willie:~/$ curl -v -XPOST -H 'Authorization: token S3CR3T' -H 'Content-Type: application/json; charset=utf-8' https://api.github.com/user/repos -d '{"name":"my-new-repo","descript

我已使用相应的响应执行了以下命令。
但是,如果我试图获取有关
/user
的信息,它会起作用,这意味着我的令牌是有效的

我做错了什么

guto@willie:~/$ curl -v -XPOST -H 'Authorization: token S3CR3T' -H 'Content-Type: application/json; charset=utf-8'  https://api.github.com/user/repos -d '{"name":"my-new-repo","description":"my new repo description"}'
输出:

* About to connect() to api.github.com port 443 (#0)
*   Trying 207.97.227.243... connected
* Connected to api.github.com (207.97.227.243) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using AES256-SHA
* Server certificate:
*    subject: O=*.github.com; OU=Domain Control Validated; CN=*.github.com
*    start date: 2009-12-11 05:02:36 GMT
*    expire date: 2014-12-11 05:02:36 GMT
*    subjectAltName: api.github.com matched
*    issuer: C=US; ST=Arizona; L=Scottsdale; O=GoDaddy.com, Inc.; OU=http://certificates.godaddy.com/repository; CN=Go Daddy Secure Certification Authority; serialNumber=07969287
*    SSL certificate verify ok.
> POST /user/repos HTTP/1.1
> User-Agent: curl/7.21.3 (x86_64-pc-linux-gnu) libcurl/7.21.3 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
> Host: api.github.com
> Accept: */*
> Authorization: token S3CR3T
> Content-Type: application/json; charset=utf-8
> Content-Length: 62
> 
< HTTP/1.1 404 Not Found
< Server: nginx/1.0.4
< Date: Tue, 27 Dec 2011 03:45:12 GMT
< Content-Type: application/json; charset=utf-8
< Connection: keep-alive
< Status: 404 Not Found
< X-RateLimit-Limit: 5000
< ETag: "31b00b4920d3470b70611b10e0ba62a7"
< X-OAuth-Scopes: public_repo, user
< X-RateLimit-Remaining: 4976
< X-Accepted-OAuth-Scopes: repo
< Content-Length: 29
< 
{
  "message": "Not Found"
}
* Connection #0 to host api.github.com left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):
guto@willie:~/projetos/apostilas/4linux-helper$ 
*即将()连接到api.github.com端口443(#0)
*正在尝试207.97.227.243。。。有联系的
*已连接到api.github.com(207.97.227.243)端口443(#0)
*已成功设置证书验证位置:
*卡菲尔:没有
CApath:/etc/ssl/certs
*SSLv3,TLS握手,客户端hello(1):
*SSLv3,TLS握手,服务器hello(2):
*SSLv3,TLS握手,证书(11):
*SSLv3,TLS握手,服务器完成(14):
*SSLv3、TLS握手、客户端密钥交换(16):
*SSLv3,TLS更改密码,客户端你好(1):
*SSLv3,TLS握手,完成(20):
*SSLv3,TLS更改密码,客户端你好(1):
*SSLv3,TLS握手,完成(20):
*使用AES256-SHA的SSL连接
*服务器证书:
*主题:O=*.github.com;OU=已验证的域控制;CN=*.github.com
*开始日期:2009-12-11 05:02:36 GMT
*过期日期:2014-12-11 05:02:36 GMT
*subjectAltName:api.github.com匹配
*发行人:C=美国;ST=亚利桑那州;L=斯科茨代尔;O=GoDaddy.com,Inc。;OU=http://certificates.godaddy.com/repository; CN=安全的证书颁发机构;序列号=07969287
*SSL证书验证正常。
>POST/user/repos HTTP/1.1
>用户代理:curl/7.21.3(x86_64-pc-linux-gnu)libcurl/7.21.3 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
>主持人:api.github.com
>接受:*/*
>授权:令牌S3CR3T
>内容类型:application/json;字符集=utf-8
>内容长度:62
> 
未找到
检查:

您需要拥有回购
范围,才能拥有创建回购的权利,如SO问题“”所示

对公共和私人回购的DB读/写访问和Git读访问

注意:应用程序可以在初始重定向中请求作用域。
可以通过用逗号分隔多个作用域来指定它们

试用

curl -v -X POST -H 'Content-Type: application/x-www-form-urlencoded' -d '{"name":"my-new-repo","description":"my new repo description"}' https://api.github.com/user/repos?access_token=S3CR3T

我知道,但是如果你看一下服务返回的标题。我已经在这些作用域上注册:repo”而不是“
public\u repo
”,但我想您的帐户仅用于管理公共回购(而非私人回购)。唯一的其他解释是某些类型/错误的参数。不幸的是,这些参数没有任何错误。如果我使用了无效的令牌访问,服务将给出未经授权的错误。我真的不知道为什么。方法名正常,参数正常,令牌正常,即使内容类型正常。还有什么@古托米亚:你有没有试过其他回购协议。或者让其他合作者在他们自己的回购协议上尝试同样的命令?
repo
https://github.com/login/oauth/authorize?
  client_id=...&
  scope=user,public_repo
curl -v -X POST -H 'Content-Type: application/x-www-form-urlencoded' -d '{"name":"my-new-repo","description":"my new repo description"}' https://api.github.com/user/repos?access_token=S3CR3T