Fast URL validation?

Erik Max Francis max at alcyone.com
Tue Mar 11 17:34:49 EST 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 = r1.read()
> >>> 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 alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Experience is the name everyone gives to their mistakes.
\__/ Oscar Wilde
    Bosskey.net: Quake III Arena / http://www.bosskey.net/q3a/
 A personal guide to Quake III Arena.




More information about the Python-list mailing list