HTTPResponse.read() returns an empty string?

Christoph Söllner christoph.soellner at web.de
Tue Oct 18 07:23:46 EDT 2005


Hi again,

my Source:
"""
import httplib
conn = httplib.HTTPConnection('www.python.org');
conn.request("GET", "/index.html");
answ = conn.getresponse();
print answ.status, answ.reason
>>> 200 OK
conn.close();
print "Start";
>>> Start
print answ.read();
>>>
print len(answ.read());
>>> 0
print "End";
>>> End

And the header states a content length of 11kBytes. What am I doin wrong?

Thanks again,
Chris 





More information about the Python-list mailing list