inblosam has asked for the wisdom of the Perl Monks concerning the following question:
Michael Jensen InBlosam Productions http://www.inblosam.com#!usr/bin/perl -w use LWP::UserAgent; use HTTP::Cookies; use HTTP::Request::Common; my $ua = LWP::UserAgent->new; $ua->cookie_jar(HTTP::Cookies->new(file => 'cookie_jar', autosave =>1) +); my $r = $ua->simple_request(POST "http://www.sitedomain.com/login.cfm" +, { username =>'abcuser', userpass =>'abc123', submit =>'Submit' }); while ($r->is_redirect) { my $u = $r->header('location') or die "missing location: ", $r->as_string; #print "redirecting to $u\n"; $u=~s/^\.+/http\:\/\/www\.sitedomain\.com/s; $r = $ua->simple_request(GET $u); } my $r = $ua->simple_request(POST "http://www.sitedomain.com/page.cfm", { firstname =>"Michael", lastname =>"Jensen", company =>"companyname", address =>"111 East 222 South", city =>"Provo", state =>"UT", zip =>"99999" }); $b = $r->as_string; if ($r->is_success) { $a = "worked"; } else{ $a = "failed"; } print "b is $b";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(podmaster) Re: LWP and HTML 302 Error
by PodMaster (Abbot) on May 21, 2002 at 10:56 UTC | |
by Anonymous Monk on May 21, 2002 at 15:09 UTC | |
by PodMaster (Abbot) on May 21, 2002 at 20:27 UTC | |
by inblosam (Monk) on May 21, 2002 at 21:00 UTC | |
by PodMaster (Abbot) on May 21, 2002 at 21:10 UTC | |
|
Re: LWP and HTML 302 Error
by arunhorne (Pilgrim) on May 21, 2002 at 12:23 UTC | |
by PodMaster (Abbot) on May 21, 2002 at 20:19 UTC | |
|
Re: LWP and HTML 302 Error
by hagus (Monk) on May 21, 2002 at 13:49 UTC |