Skip to content

Instantly share code, notes, and snippets.

View numa08's full-sized avatar
๐Ÿ

Takaya Funabiki numa08

๐Ÿ
View GitHub Profile
#!/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!"