In <[EMAIL PROTECTED]>, Christoph Söllner wrote:
> ok got it:
> One cannot close the connection before reading the answer.
Yep, because the "answer" is read over the connection.
> Seems that in my original source the new assigned variable
> 'answ' is destroyed or emptied with the connection.close()
> command; very strange behaviour.
No, it's not emptied or destroyed. The read() method reads the content
over the connection. That doesn't work if the connection is closed. It's
like closing a file and then reading from it.
The response object contains just the headers. So you can inspect them
before you decide to download the actual content.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list