簡體   English   中英

在github API上訪問github倉庫的正確端點是什么?

[英]What's the correct endpoint to access github repositories on github API?

我正在向github的API發出請求,以獲取以下各項:回購的名稱,回購所有者的名稱,回購網址,回購描述,星號,許可證類型以及回購是否為分叉。 根據github的API文檔,我有這個端點: https ://api.github.com/search/repositories?q ={ query }{& page,per_page,sort,order }

但這似乎不起作用。 我忘記了什么嗎? github API在這里: https : //help.github.com/articles/searching-repositories 這也是我的要求:

     getRepos = (repoinfo) => {
        return fetch(`https://api.github.com/search/repositories?q={query} {&page,per_page,sort,order}`)
        .then(respone => Response.json())
        .then(response => {
          return response
        })
     }

為我工作。 在這里,我在自述文件中搜索包含迷宮的存儲庫:

https://api.github.com/search/repositories?q=labyrinth+in:readme&type=repository

或者,如果您想要特定的回購協議,請使用https://api.github.com/repos/:owner/:repo這樣:

https://api.github.com/repos/draluy/labyrinth

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM