首页 > 解决方案 > 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')",),))

标签: pythonapisslgetrequest

解决方案


推荐阅读