httplib and cookies

Johann Hibschman johann at physics.berkeley.edu
Wed Jan 17 00:56:02 EST 2001


Moshe Zadka writes:

> On 16 Jan 2001 09:47:32 -0800, Johann Hibschman <johann at physics.berkeley.edu> wrote:
>> Hi folks, webby question here.
>> 
>> Is there a way I can get httplib to handle cookie setting and requests
>> from the server?

> Cookies are sent with a "Set-Cookie" header. You'll have to parse
> this (yourself: if the cookie is simple, you can use crude tricks),
> and then send this back in a "Cookie" header. You can even do it
> with urllib.FancyURLopener, just use the .addheader() method (but be
> aware that if there are redirects involved, you're probably better
> off using URLopener and handling the redirects yourself)

Okay, thanks.  I've got it working.  I like python.  I just thought
I'd mention that.  It's all so easy.  :-)

--Johann

-- 
Johann Hibschman                           johann at physics.berkeley.edu



More information about the Python-list mailing list