Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2014-12-19 21:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (92 votes), past polls