in reply to Re: POST with LWP yields HTTP 302 Not Allowed - Too bad for me?
in thread POST with LWP yields HTTP 302 Not Allowed - Too bad for me?

Thanks for your reply, although I'm still misisng it. I ran the program again, went down to the line that had the "Location:" header, and copied the redirection URI into my code, which is below:

#!/opt/gnu-irix/bin/perl use strict; use HTTP::Request::Common; use LWP::UserAgent; my $ua = new LWP::UserAgent; #my $formurl = 'http://www.usps.com:80/cgi-bin/zip4/zip4inq2'; my $formurl = 'http://148.129.65.3:80/fwauthredirect148.129.65.9id0003869786'; my $formdata = [ 'Firm' => '', 'Urbanization' => '', 'Delivery Address' => '100 Southland Vlg', 'City' => '', 'State' => '', 'Zip Code' => '36079-3044', 'Submit' => 'Process' ]; print $formurl, "\n"; my $resp = $ua->request(POST $formurl, $formdata); if ($resp->is_success()) { print $resp->content(); } else { print "Problem\n\n", $resp->as_string(); }

Running the program generated a similar response:

HTTP/1.0 302 (Found) Not Allowed Location: http://148.129.65.3:80/fwauthredirect148.129.65.9id000386993 +7 Content-Length: 120 Content-Type: text/html Client-Date: Wed, 15 May 2002 15:57:42 GMT Client-Peer: 56.0.78.101:80 Your request is being redirected to :<a href="http://148.129.65.3:80/f +wauthredirect148.129.65.9id0003869937">here</a>.

It appears that I simply got redirected again. Please advise. Thanks.