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

'fwauthredirect' is a message from your firewall (FW1). Does this same error happen when running the script with a direct connection? 56.0.78.101 is the ip address of usps.com, I'm assuming 148.129.65.3 (or 9) is the firewall's ip. You should probably talk to whoever administers the firewall.
  • Comment on Re: POST with LWP yields HTTP 302 Not Allowed - Too bad for me?

Replies are listed 'Best First'.
Re: Re: POST with LWP yields HTTP 302 Not Allowed - Too bad for me?
by Shizzle (Novice) on May 15, 2002 at 19:32 UTC
    While talking to my sys admin, it dawned on me that our firewall had not authenticated me from the account where the perl scripts were written. See, when I was trying to figure out why I could use my browser and not LWP, I was surfing with IE on my local PC. So, from the Unix account where my perl scripts were, I fired up Netscape and typed www.usps.com. I supplied the firewall with my username and password, ran the perl script again, and got the desired results. Thanks to everyone for your feedback.
      It seems now the Post office doesn't let this work anymore:

      HTTP/1.1 405 Method Not Allowed
      Connection: close
      Date: Wed, 17 Mar 2010 18:07:28 GMT
      Server: Netscape-Enterprise/6.0
      Vary: Accept-Encoding
      Allow: HEAD, GET
      Content-Length: 124
      Content-Type: text/html
      Client-Date: Wed, 17 Mar 2010 18:07:27 GMT
      Client-Peer: 96.16.57.188:80
      Client-Response-Num: 1
      Title: Method Not Allowed

        Try setting the "user agent" string in LWP to something else.

        eg:

        use LWP::UserAgent; use HTTP::Request::Common; my $ua = LWP::UserAgent->new(); $ua->agent( "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1)" ); my $request = POST "http://the.url/the.page", { foo => 'bar', baz => 'bux', }; my $result = $ua->request( $request ); print $result->as_string;