簡體   English   中英

Github 個人身份驗證令牌不適用於 Github API

[英]Github Personal Authentication Token not working for Github API

我正在嘗試使用我的個人身份驗證令牌請求https://api.github.com/search/issues?q=repo:react+state:open&sort=created&order=desc&per_page=100&page=1但它總是返回 422。 我使用令牌的方式是這樣的標題:

{
  headers: {
    authorization: `token ${myToken}`
  }
}`

我不知道我是否做錯了什么,但我想這段代碼應該可以正常工作。

以防萬一,在閱讀“如何使用 Axios 發送授權 header ”后,嘗試:

axios.get('https://api.github.com/search/issues?q=react+state:open&sort=created&order=desc&per_page=100&page=1', {
  headers: {
    'Authorization': `token ${access_token}`
  }
})

考慮到它的格式最近發生了變化(2021 年 3 月),也嘗試生成您的令牌

正如下面的OP Gabriel Mazurco評論的,沒有更多的repo: .

暫無
暫無

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

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