httplib2错误中的ResponseNotReady异常

时间:2014-05-12 11:39:55

标签: python httplib2

我只是尝试执行特定的api来获取对象列表,

import httplib2
h = httplib2.Http()
print ('=== G E T T I N G ===')
resp_headers, content = h.request("http://content.guardianapis.com/search?
q=obama&format=json", "GET")
print ('=== D O N E ===')

从IDLE2.7运行时,这给了我这个错误: -

raise ResponseNotReady()

请告诉我我做错了什么。

1 个答案:

答案 0 :(得分:0)

这很好用

import httplib2

h = httplib2.Http(".cache")
(resp_headers, content) = h.request("http://content.guardianapis.com/search?q=obama&format=json", "GET")

print content