Salnet007 / httplib2

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

Retrieve response data lazily #103

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Would it be possible to add a method to the Http object to only download the 
response headers and not the response data, like urllib.urlopen does? The use 
case for this suggestion is that often you are only interested in checking that 
the url works properly, which you can do by reading the headers, so it is 
wasteful to also download the whole document. 

Original issue reported on code.google.com by bjou...@gmail.com on 3 Jul 2010 at 11:57

GoogleCodeExporter commented 9 years ago
That's what an HTTP HEAD request does.  Just do this:

http.request(uri, method="HEAD")

Original comment by mackst...@gmail.com on 4 Jul 2010 at 2:01

GoogleCodeExporter commented 9 years ago
I didn't know about the head method. :) That works for me.

Original comment by bjou...@gmail.com on 4 Jul 2010 at 11:32

GoogleCodeExporter commented 9 years ago
Marking as resolved then :)

Original comment by joe.gregorio@gmail.com on 4 Jul 2010 at 5:07