【发布时间】:2017-01-08 20:14:07
【问题描述】:
当尝试使用 python 3 授权 spotify 时,我收到一个带有描述“意外状态:400”的“server_error”。
我使用了正确的授权代码,并且 spotify 文档 (https://developer.spotify.com/web-api/authorization-guide/) 指示我使用带有这些参数的 post 命令。
我在这方面是个菜鸟,我不知道我做错了什么。
代码如下:
import requests
params = {'grant_type': 'authorization_code', 'code': authcode, 'redirect_uri': 'https://example.com/callback','client_id':'example', 'client_secret':'example'}
req=requests.post('https://accounts.spotify.com/api/token', params=params)
print(req.content)
【问题讨论】:
标签: python python-3.x post spotify