【发布时间】:2017-08-29 07:53:56
【问题描述】:
我正在尝试使用 django 发送请求,以使用 OAuth2 从我的 api 获取 access_token。我正在执行这段代码:
data = {'username': 'admin', 'password': '123123', 'grant_type':
'password','client_id': 'xxx','client_secret': 'xxx'}
headers = {'content-type': 'application/x-www-form-urlencoded'}
r = requests.post(url, data=data, headers=headers)
当我发送此请求时,我收到此错误:
{'error': 'unsupported_grant_type'}
感谢您的帮助!
【问题讨论】: