【发布时间】:2018-08-31 21:15:56
【问题描述】:
我在通过 python 使用访问令牌执行 GET 请求时遇到了一些困难。 出于某种原因,当我执行来自 POSTMAN 的请求时,我得到了预期的结果,但是,当使用 python 时,我得到了连接错误:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
我相信我的脚本被服务器阻止以防止尝试报废,但我不确定。 这就是我通过 POSTMAN 运行的:
https://www.operation.io/web/alerts?access_token=6ef06fee265de1fa640b6a444ba47--z&envId=58739be2c25e76a202c9dd3e&folderId=active&sortBy=status
这就是我在 脚本 中运行的内容:
response = requests.get('https://www.operation.io/web/alerts', headers={'Authorization': 'access_token 6ef06fee265de1fa640b6a444ba47--z'})
请注意url和access token不是真实的,请勿尝试使用。 如何通过脚本而不是仅通过邮递员使其工作? 谢谢你的帮助/
【问题讨论】:
-
'Authorization': '6ef06fee265de1fa640b6a444ba47--z'
标签: python get postman access-token