in reply to •Re: LWP::UserAgent subclass to make it follow redirects after POST (like Netscape)
in thread LWP::UserAgent subclass to make it follow redirects after POST (like Netscape)

Doing that is not enough. The POST request must be converted into a GET request by the agent and its content removed. That's Netscape's exact behavior, as far as I remember (I wrote this code about a year ago). This snippet in my code does it:
if($request->method eq 'POST') { $referral->method('GET'); $referral->content(''); }
Last time I checked UserAgent was not doing this as a result of overriding redirect_ok().

Update: This is a reply to Merlyn's original post, in which redirect_ok simply returned a 1.

  • Comment on Re: •Re: LWP::UserAgent subclass to make it follow redirects after POST (like Netscape)
  • Download Code