mak has asked for the wisdom of the Perl Monks concerning the following question:
# Create a user agent object use LWP::UserAgent; $ua = new LWP::UserAgent; $ua->agent("AgentName/0.1 " . $ua->agent); # Create a request my $req = new HTTP::Request POST=> 'http://www.genesisreports.com/ge +nesis/user/mypage.asp'; # Pass request to the user agent and get a response back $ua->credentials('http://www.genesisreports.com/genesis/user/mypage. +asp', 'admin', 'username', 'password'); my $res = $ua->request($req); print $req->as_string(); # Check the outcome of the response if ($res->is_success) { print $res->content; } else { print "Bad luck this time\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using credentials method of UserAgent
by traveler (Parson) on May 19, 2001 at 01:17 UTC | |
by no_slogan (Deacon) on May 19, 2001 at 01:23 UTC | |
by traveler (Parson) on May 19, 2001 at 01:35 UTC | |
by damnFool (Initiate) on Aug 03, 2001 at 22:41 UTC | |
|
Re: Using credentials method of UserAgent
by princepawn (Parson) on May 19, 2001 at 00:35 UTC | |
by mak (Initiate) on May 19, 2001 at 01:08 UTC |