On 08/25/2007 07:39 PM, Gunnar Hjalmarsson wrote:
Mumia W. wrote:
On 08/25/2007 04:32 PM, Gunnar Hjalmarsson wrote:
Jeff Pang wrote:
2007/8/25, Praveena Vittal <[EMAIL PROTECTED]>:
 I want to redirect to a different url with the parameters in the post
method.

Well,see 'perldoc CGI' and specially check for,
param,
redirect.

How do you combine a POST request and a 'Location:' header (which is what CGI::redirect prints AFAIK)?

I think this is called a Status 307 Temporary Redirect. See RFC 2616 ยง 10.3.8.

This is the last para of that section:
"If the 307 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued."

So I don't think that 307 is the proper status code for a redirect via a POST request. In any case it doesn't answer the question how you do it, does it?


I do wish the Praveena had been more specific about what he or she is trying to do, but, if status 307 is appropriate, this is how it can be done with CGI.pm:

use strict;
use warnings;
use CGI;

# You set the $location.

print CGI::header(
    -status => '307 Temporary Redirect',
    -location => $location,
);


__END__

An HTTP body should also be provided with a link to the new resource, but it is not required.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to