ok got it:
One cannot close the connection before reading the answer.
Seems that in my original source the new assigned variable
'answ' is destroyed or emptied with the connection.close()
command; very strange behaviour.
> """
> 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


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to