using urllib or httplib to post with ENCTYPE=mulitpart/form-data

John J. Lee jjl at pobox.com
Mon Jun 9 16:10:00 EDT 2003


Kevin Carlson <nskhcarlso at bellsouth.net> writes:
[...]
> Is there any way to use ClientCookie with httplib rather that urllib
> or urllib2?

No reason why not, but IMHO perverse.  :-)

You just have to call extract_cookies and add_cookie_header manually,
which means you need to make a couple of objects that satisfy the
request and response interfaces specified in the docstrings for those
methods (easy enough I guess, though I haven't done it myself):

from ClientCookie import Cookies
print Cookies.extract_cookies.__doc__
print Cookies.add_cookie_header.__doc__

I just released a 0.4.1a version.  Despite the alpha status, I
recommend using that if you're writing new code (or even if you're
not, probably).


John




More information about the Python-list mailing list