【发布时间】:2021-06-20 20:44:06
【问题描述】:
我目前正在开发一个应用程序,它的一个功能是它可以将歌曲添加到用户的队列中。我为此使用了 Spotify API,这是我的代码:
async def request():
...
uri = "spotify:track:5QO79kh1waicV47BqGRL3g" # temporary, can change later on
header = {'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': "{} {}".format(TOKEN_TYPE, ACCESS_TOKEN)}
data = {'uri': uri}
resp = requests.post(url="https://api.spotify.com/v1/me/player/queue", data=data, headers=header)
...
我尝试了很多东西,但似乎无法理解为什么会收到错误 400(错误 400:缺少必需的参数 uri)。
【问题讨论】:
标签: python post request spotify