[Tutor] Download file via HTTP GET with progress monitoring & custom headers?

xbmuncher xboxmuncher at gmail.com
Mon Aug 11 00:09:27 CEST 2008


I want to download a file via HTTP GET protocol (perhaps HTTP POST in the
future, whatever method should allow relativly easy changes to be made to
use POST later on)
I need to send custom headers like in urllib2.urlrequest()
I need to be able to monitor the download progress WHILE it downloads like
the hook function in urllib

I looked into urllib2 and it did everything except allow me to check the
progress of the download during the download, it only downloads the file
first with urlopen(). I also tried urllib and the reporthook function is
great, except I can't send custom headers! I wish I could send a REQ object
to the urlretrieve() function in urllib that way I can prepare those custom
headers.. :(

I was looking at the httplib library, its a little complicated/intimidating
to me, maybe it can be done in this?

Anyways, i would appreciate if soemone could write me a quick example to do
this, or point me to the right library/funcs to do it. I want to be able to
do it in native python libraries.

-thanks for reading
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080810/11823300/attachment.htm>


More information about the Tutor mailing list