Passing a Cookie with httplib

scott at bogusaddress.com scott at bogusaddress.com
Thu Jun 29 07:57:23 EDT 2006


On Thu, 29 Jun 2006 21:42:50 +1200, Lawrence D'Oliveiro
<ldo at geek-central.gen.new_zealand> wrote:

>According to <http://docs.python.org/lib/httpconnection-objects.html>, 
>you can pass additional "body" and "headers" args to 
>HTTPConnection.request. How about trying something like this in place of 
>the last line above:
>
>    Headers = {"Cookie" : 
>"auth=buster%3A12345678901234567890exZ9rzMqgtxa5A"}
>    conn.request('GET',WP_PATH % uservalue, None, Headers)

Perfect!  Thanks so much.  I appreciate your help. I looked through
the docs before, but didn't spot this nugget because I was focused on
searching for the text "cookie".  Obviously, it pays to read... :-) 

Scott



More information about the Python-list mailing list