【发布时间】:2021-03-10 14:39:09
【问题描述】:
对不起这个标题,但我真的需要 hlp。我不知道为什么这不起作用,我搜索了很多。
所以我正在使用 Spotify Api,我想访问 Access_Token。文档说你必须这样做:Spotify Documentation
我要求这样:
fetch ('https://accounts.spotify.com/api/token', {
method: 'post',
body: {
code: code,
redirect_uri: redirectUri,
grant_type: 'authorization_code'
},
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: 'Basic ' + btoa(clientId+':'+clientSecret)
},
json: true
})
但这就是回答这个问题: Error
我检查并发现错误 400 表示“错误请求”。
你有想法吗?感谢您的帮助!
【问题讨论】:
标签: javascript api spotify client-side