trungn1992 / httplib2

Automatically exported from code.google.com/p/httplib2
0 stars 0 forks source link

Support chunked transfer encoding via a generator #132

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
With memory footprints and streaming connections in mind it would seem ideal to 
optionally have the request() method return a generator instead of the full 
response at once.

Maybe something like:

  (code, content) = http.request(uri, "GET", steaming=True)

  for chunk in content:
    print chunk

where streaming=True would indicate a generator is requested. Each chunk of a 
chunked HTTP transfer would map onto a yield in the generator.

Original issue reported on code.google.com by pieterennes on 21 Feb 2011 at 11:07

GoogleCodeExporter commented 8 years ago

Original comment by joe.gregorio@gmail.com on 21 Feb 2011 at 11:33