【发布时间】:2019-11-07 18:58:01
【问题描述】:
我有一个 python 代码,我在其中使用凭据从 url 获取令牌。它是从邮递员那里工作的。但不是来自python3。
headers = {'Content-type': 'Application/json', 'Accept': 'Application/json'}
data={ "username" : "someuser", "authSource" : "ADS", "password" : "somepasswd"}
req = requests.post(('https://example.com/suite-api/api/auth/token/acquire', data, headers=headers).json())
print(req)
上面的代码不起作用。它应该生成一个带有一些随机字符的令牌。
我希望输出为 7aaf-321b-82ab-7f55-2233891adb::5sde-3wqa-8sab
【问题讨论】:
标签: python-3.x