【发布时间】:2010-07-12 19:24:53
【问题描述】:
我正在使用 python 为 elgg 编写一个 REST 客户端,即使请求成功,我也会得到以下响应:
Traceback (most recent call last):
File "testclient.py", line 94, in <module>
result = sendMessage(token, h1)
File "testclient.py", line 46, in sendMessage
res = h1.getresponse().read()
File "C:\Python25\lib\httplib.py", line 918, in getresponse
raise ResponseNotReady()
httplib.ResponseNotReady
查看标题,我看到 ('content-length', '5749'),所以我知道那里有一个页面,但我无法使用 .read() 来查看它,因为出现了异常。 ResponseNotReady 是什么意思,为什么我看不到返回的内容?
【问题讨论】:
-
你在重用连接吗?
-
确实如此。奇怪的是,有时它有效,有时则无效。不过,我无法确定是什么行为决定了这一点。