Fast URL validation?

Erik Max Francis max at
Tue Mar 11 23:34:49 CET 2003

Thomas Weholt wrote:

> If r1.status is something other than 200 then the document is either
> missing, server failure or your request will be redirected etc. If you
> wanted to read the entire document you'd have to do this before
> closing the
> connection:
> >>> document =
> >>> conn.close()
> Or something similar. Don't know if this is the fastest way of doing
> it.
> Please, post a better solution if you find one.

I suspect this probably wouldn't make much of a difference; my suspicion
is that (at least a buffer's full) of the content will be downloaded
regardless of when you call close on the connection object, so long as
you've invoked getresponse.

 Erik Max Francis / max at /
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Experience is the name everyone gives to their mistakes.
\__/ Oscar Wilde Quake III Arena /
 A personal guide to Quake III Arena.

More information about the Python-list mailing list