Handling cookies without urllib2 and cookielib

Joshua Kugler jkugler at bigfoot.com
Fri Dec 14 21:44:11 EST 2007


Standard disclaimer: read, googled, read some more.  If you have a link,
please free free to point me there.

I'm using HTTPlib to construct some functional tests for a web app we're
writing.  We're not using urllib2 because we need support for PUT and
DELETE methods, which urllib2 does not do.

We also need client-side cookie handling.  So, I start reading about
cookielib and run across a problem.  It's cookie handling is tied quite
tightly to urllib2's request object.  httplib has somewhat different
semantics in its request object.  So, you can use cookielib with httplib. 
And cookie lib has no simple function (that I could find) for passing in a
set-cookie header and getting back a CookieJar object (or even a list of
Cookie objects).

I'm sure I'm not the first to have to deal with httplib and cookies.  Anyone
have suggestions or pointers?

j




More information about the Python-list mailing list