http访问返回异常

wanj2015 wanj2015 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
思路:我用python连接微信端实现微信机器人。运行了一段时间比较稳定,但是这两天总是时不时的抛异常,严重时经常掉线

微信那边正常返回的信息:HTTP/1.1 200 OK 但是有时返回:HTTP/1.1 0 - 返回码不是200而是0.这个0是代表什么意思?

具体错误信息:
Traceback (most recent call last):
File "D:\Python\Python36-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 600, in urlopen
chunked=chunked)
File "D:\Python\Python36-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 386, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File "D:\Python\Python36-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 382, in _make_request
httplib_response = conn.getresponse()
File "D:\Python\Python36-32\lib\http\client.py", line 1331, in getresponse
response.begin()
File "D:\Python\Python36-32\lib\http\client.py", line 297, in begin
version, status, reason = self._read_status()
File "D:\Python\Python36-32\lib\http\client.py", line 285, in _read_status
raise BadStatusLine(line)
http.client.BadStatusLine: HTTP/1.1 0 -


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\Python\Python36-32\lib\site-packages\requests\adapters.py", line 423, in send
timeout=timeout
File "D:\Python\Python36-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 649, in urlopen
_stacktrace=sys.exc_info()[2])
File "D:\Python\Python36-32\lib\site-packages\requests\packages\urllib3\util\retry.py", line 347, in increment
raise six.reraise(type(error), error, _stacktrace)
File "D:\Python\Python36-32\lib\site-packages\requests\packages\urllib3\packages\six.py", line 685, in reraise
raise value.with_traceback(tb)
File "D:\Python\Python36-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 600, in urlopen
chunked=chunked)
File "D:\Python\Python36-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 386, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File "D:\Python\Python36-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 382, in _make_request
httplib_response = conn.getresponse()
File "D:\Python\Python36-32\lib\http\client.py", line 1331, in getresponse
response.begin()
File "D:\Python\Python36-32\lib\http\client.py", line 297, in begin
version, status, reason = self._read_status()
File "D:\Python\Python36-32\lib\http\client.py", line 285, in _read_status
raise BadStatusLine(line)
requests.packages.urllib3.exceptions.ProtocolError: ('Connection aborted.', BadStatusLine('HTTP/1.1 0 -\r\n',))

During handling of the above exception, another exception occurred:
...全文

相关推荐

评论 3
收藏 已收藏
分享
返回顶部
wanj2015
脚本语言 37,737 成员 34,208 内容