Fil*_*ill 5 github graphql fetch-api
我正在尝试使用生成的 git 令牌发出请求,但似乎我进行了错误的身份验证,我做错了什么?
const token = 'my github token'
fetch('https://api.github.com/graphql', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'bearer' + token
},
body: JSON.stringify({ query: QUERY })
})
.then(res => res.json())
.then(data => console.log(data))
}
Run Code Online (Sandbox Code Playgroud)
错误信息:
{message: '此端点需要您进行身份验证。'}
| 归档时间: |
|
| 查看次数: |
1894 次 |
| 最近记录: |