Making a persistent HTTP connection

Diez B. Roggisch deets at nospam.web.de
Mon Nov 14 16:30:21 EST 2005


David Rasmussen wrote:
> I use urllib2 to do some simple HTTP communication with a web server. In 
> one "session", I do maybe 10-15 requests. It seems that urllib2 opens op 
> a connection every time I do a request. Can I somehow make it use _one_ 
> persistent connection where I can do multiple GET->"receive data" passes 
> before the connection is closed?

Are you sure HTTP supports that? This would be news to me - which 
doesn't mean much :)

And even if it works - what is the problem with connections being created?

Regards,

Diez



More information about the Python-list mailing list