This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import httplib | |
import simplejson | |
# Based on Christian Dowski's iresponse http://blog.dowski.com/2008/04/02/reading-chunked-http11-responses/ | |
class IterableResponse(httplib.HTTPResponse, object): | |
def __iter__(self): | |
assert self.chunked != httplib._UNKNOWN, "Response is not chunked!" |
NewerOlder