python - Python Request API 在邮递员中有效,在 python 中无效(Bad HandShake)
问题描述
我的代码:
从 requests.auth 导入请求 import HTTPBasicAuth url = ' https://104.41.29.106/apibasic/linkdados/v1/qtlink?funcionalidade=RELATORIO&selecao=Fundos%20MM%20Macro%20e%20LS&configuracao=Fundos%20MM%20Macro%20e%20LS '
headers = {'user-agent': '自定义标题字符串', 'Content-Type': 'application/gzip; 字符集=utf-8'}
r = requests.get(url, auth=HTTPBasicAuth('xxx', 'xxx'), headers=headers, verify=False) print(r.text)
错误:requests.exceptions.SSLError: HTTPSConnectionPool(host='104.41.29.106', port=443): Max retries exceeded with url: /apibasic/linkdados/v1/qtlink?funcionalidade=RELATORIO&selecao=Fundos%20MM%20Macro%20e% 20LS&configuracao=Fundos%20MM%20Macro%20e%20LS (由 SSLError(SSLError("bad handshake: SysCallError(10054, 'WSAECONNRESET')",),))
解决方案
推荐阅读
- c# - 网络中断时C# Ftp上传,如何恢复?
- sql - 单元格值 = 0 时,like 和 = 之间的区别
- git - 有没有办法使用 LibGit2Sharp 重命名远程 GitHub 存储库?
- kotlin - 扩展一个 T 类型,将其类所需的任何行为委托给 T
- java - Java - 我如何知道 Math.rand() 或 Random 会生成哪个数字?
- python - 如何在 Python 中将字典格式的 Excel 文件与字典相结合
- javascript - 什么是虚假的?为什么要进行重复数据删除?为什么console.log() 在foreach 前面包含答案?
- android - 序列化Generic类型的ArrayList时,Gson解析为LinkedTreeMap
- twilio - 在 Twilio Studio Flow 中获取录音 Sid
- ios - 使用 FSCalendar 的事件表