GET 请求:http.client.RemoteDisconnected:远程端关闭连接无响应

问题描述

我正在尝试使用代理对位于我公司防火墙下的 url 执行 GET 请求。身份验证可以是 SSO。为此,我提供用户名和密码。代码

response = requests.get(url=url,proxies=proxiesDict,auth=HTTPBasicAuth(username,password))
print(response.status_code)

但我收到以下错误

 File "/usr/pkgs/python3/3.6.3/lib/python3.6/http/client.py",line 266,in _read_status
    raise Remotedisconnected("Remote end closed connection without"
http.client.Remotedisconnected: Remote end closed connection without response

如果我添加带有某个值(如 90)的 timeout,它会在 90 秒后杀死它。我知道用户名和密码是有效的,因为如果我更改密码中的一个字母,我会自动获得 401 状态代码。为什么会发生?如何调试此类问题?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)