Github API返回404,但默认的http请求返回301

时间:2014-03-28 14:08:25

标签: redirect github-api

我尝试获取Github存储库信息。

  1. 首先进行一些测试。我有下一个网址:

      

    https://github.com/airbnb/rendr

    当我将其粘贴到我的浏览器时,它会将我重定向到

      

    https://github.com/rendrjs/rendr

    如果我首先通过curl尝试链接,则会返回状态301并显示Location: https://github.com/rendrjs/rendr

  2. 我尝试使用Github API获取存储库信息。为此我们应该这样称呼:

    https://api.github.com/repos/:owner/:repo

    但是当我尝试curl -i "https://api.github.com/repos/airbnb/rendr"时,我收到404错误;对于curl -i "https://api.github.com/repos/rendrjs/rendr"我获取了信息和状态200.如果我添加Accept: application/vnd.github.v3+json标题(使用API v3,默认为beta)我的结果相同。

  3. 那么,我能以某种方式使用Github API和第一个链接获取存储库信息吗?我期望至少301像默认的http请求。

0 个答案:

没有答案
相关问题