sylph001 has asked for the wisdom of the Perl Monks concerning the following question:
Hi Perl Monks,
I'm not familiar with the many HTTP related modules.
I'm in urgent need to make a LWP GET request along with a predefined cookie in the header.
Is my following code correct and will it work?
I'm especially worried about the data structures I used.
345 use HTTP::Headers; 346 my $h = HTTP::Headers->new; 347 $h->header( Cookie => 'ASP.NET_SessionId=xaduwqpg5ocnenpb +0l0xsq4d; GMProfileInfo=e=xxxx@banana.com' ); 348 349 $dl_res = $ua->request( 350 GET $Url, 351 %$h, 352 content=> [ 353 %$asp_state 354 ] 355 );
Thanks much!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Adding cookies into headers of LWP request
by McA (Priest) on Sep 25, 2014 at 14:52 UTC | |
by Loops (Curate) on Sep 25, 2014 at 15:45 UTC | |
|
Re: Adding cookies into headers of LWP request
by sylph001 (Sexton) on Sep 25, 2014 at 15:40 UTC | |
by Loops (Curate) on Sep 25, 2014 at 16:12 UTC |