我正在调用Spotify API获取刷新令牌,但一致地获取方法{“error”:“unsupported_grant_type”,“error_description”:“grant_type parameter is missing”},即使我的代码读取grant_type: 'refresh_token'
,并且在阅读文档后,我不确定该问题,任何帮助都将不胜感激!
这是我目前为止的代码
@response = HTTParty.post("https://accounts.spotify.com/api/token",
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: {
grant_type: 'refresh_token',
refresh_token: ENV['REFRESH_TOKEN'],
client_id: ENV['CLIENT_ID']
}.to_json)
字符串
1条答案
按热度按时间nr7wwzry1#
刷新令牌的请求必须经过授权:
字符串