Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
As I know, POST requires to change its default setting to 'redirectable'. Once I changed it, does it mean that the response requested by POST would be redirected AUTOMATICALLY to the final destination?
Thx

Replies are listed 'Best First'.
Re: Redirection in LWP with POST
by gargle (Chaplain) on Sep 26, 2005 at 08:45 UTC

    Hi,

    LWP::Useragent doesn't automatically follow a redirect as an answer to a POST. So you need to change the default setting.

    Change the default setting applies to LWP::Useragent, your script, NOT the server. LWP::Useragent is your browser. So a 302 reply from the server makes your browser point to the new destination. Without the change in default setting LWP:Useragent wouldn't reflect this change.

    --
    if ( 1 ) { $postman->ring() for (1..2); }
      Hi,
      Actually, the response I got through POST is a page that should redirect itself to give a final page after the server finished its calculation. The calculation takes time to do it.

      I changed the default setting in my script, but I couldn't get the final page.

      Does the redirection 'consider' the resquest finished because the server 'looks' idle for a while during calculation and then terminate the resquest?
      I'm not sure the problems I got, just make a guess.

      thx
Re: Redirection in LWP with POST
by sauoq (Abbot) on Sep 26, 2005 at 07:58 UTC

    Huh?

    -sauoq
    "My two cents aren't worth a dime.";