Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

by gregorovius (Friar)
on Feb 26, 2002 at 16:29 UTC ( [id://147622]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://147622]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-16 20:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found