0
我試圖Get
GitHub的graphQL端點使用axios
和它不斷包圍我,說我沒有通過認證:爲什麼Github的GraphQL API 401與Axios?
const handleClick = token => event =>
axios.get("https://api.github.com/graphql", {
headers: { "Authorization": "bearer" + token}
}).then(response => console.log(response))
我回來這個錯誤:
GET https://api.github.com/graphql 401 (Unauthorized)
bundle.js:1475 Uncaught (in promise) Error: Request failed with status code 401
at createError (bundle.js:1475)
at settle (bundle.js:1619)
at XMLHttpRequest.handleLoad (bundle.js:1028)
createError @ bundle.js:1475
settle @ bundle.js:1619
handleLoad @ bundle.js:1028