[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Browsing with Cookies

Warren Brown

5/25/2005 4:38:00 PM

Jim,

> One of them relys on cookies to get the data in a form I
> can use. Net::HTTP appears not to use cookies, even if
> you're inside the same .start block.
> ...
> Is there a way to provide a cookie? I could likely
> synthesize the information that the server was looking for.

A cookie is just another HTTP header, so you can add it manually in
the second parameter (headers) of Net::HTTP#get or Net::HTTP#post. The
format is pretty simple:

Cookie: $Version="1"; MyKey="MyValue"; $Path="/mypath"

See RFC2965 for the nitty-gritty details.

I hope this helps.

- Warren Brown