Cookies are just HTTP headers. There is no reason why you can't send them.
Something like this should work.
my @form = qw(param1=val1 param2=val2);
my $request = HTTP::Request->new(POST => $url);
$request->header('Cookie' => 'cookie1=val1');
$request->content_type('application/x-www-form-urlencoded');
$request->content(join('&', @form));
my $response = $agent->request($request);
On Thu, Aug 4, 2011 at 3:37 PM, Shmuel Fomberg <[email protected]> wrote:
> Hi All.
>
> Can anyone tell me how do I send a POST request using the LWP::UserAgent
> module, with a cookie?
> there are a lot of similar questions on the web, but all of them end
> with "this does not work".
>
> Shmuel.
> _______________________________________________
> Perl mailing list
> [email protected]
> http://mail.perl.org.il/mailman/listinfo/perl
>
_______________________________________________
Perl mailing list
[email protected]
http://mail.perl.org.il/mailman/listinfo/perl