Marc 'BlackJack' Rintsch
In <dj2m7k$s7n$1@wsc10.lrz-muenchen.de>, Christoph Söllner wrote:
[color=blue]
> ok got it:
> One cannot close the connection before reading the answer.[/color]
Yep, because the "answer" is read over the connection.
[color=blue]
> Seems that in my original source the new assigned variable
> 'answ' is destroyed or emptied with the connection.close()
> command; very strange behaviour.[/color]
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 |