Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 ( #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
Node Status?
node history
Node Type: note [id://147622]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2015-07-06 10:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (71 votes), past polls