CGI module redirect defaults to 302 -- why?



If the 302 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.
-- HTTP/1.1

For a CGI program that was requested from a POST form, the 302 message
seems to not be what I would want. But 303:

The response to the request can be found under a different URI
and SHOULD be retrieved
using a GET method on that resource. This method exists
primarily to allow the output of a
POST-activated script to redirect the user agent to a selected
resource. The new URI is not a
substitute reference for the originally requested resource.
HTTP/1.1

303 seems to be designed *exactly* for redirecting the browser after a
CGI program has run. Why then does the CGI module return a 302
response by default?

.



Relevant Pages

  • Re: CGI module redirect defaults to 302 -- why?
    ... The response to the request can be found under a different URI ... POST-activated script to redirect the user agent to a selected ... 303 seems to be designed *exactly* for redirecting the browser after a CGI program has run. ...
    (comp.lang.perl.misc)
  • Re: Redirecting to another url with parameters using post method
    ... what CGI::redirect prints AFAIK)? ... "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." ...
    (perl.beginners)
  • Re: Redirecting to another url with parameters using post method
    ... "If the 307 status code is received in response to a request other than ... the user agent MUST NOT automatically redirect the request ... POST request. ...
    (perl.beginners)
  • Re: How to invoke a CGI script within a Perl program ?
    ... I have a perl program does something and then I need to ... # This example shows how the user agent, a request and a response are ...
    (comp.lang.perl.modules)
  • Re: Problems with HttpWebRequest
    ... Could this 'Simple Response' be the problem? ... > Does the initial request cause a redirect to a default page? ... > I know you said the server does not return a header, but a redirect ... >>What is a little bit special about the resource that i request is that the ...
    (microsoft.public.dotnet.framework.aspnet)