Re: What method for Location?

>From: (Koen Holtman)
>>If my client does a "POST URI HTTP/1.1" and the server responds
>>with "Location: NEWURL"
>>What shall my client do next?  Shall I do "POST NEWURL ..."
>>or "GET NEWURL ..."?
>That depends on the status code of the response message the Location is in,
>so you have to look at section 10.3 of the spec.  And note the notes in
>there about what some clients actually do.

I looked into that section.  The spec does not explicitly say which method
should be used for the NEWURL.  The notes for 301 and 302 responses,
     Note: When automatically redirecting a POST request after receiving
     a 302 status code, some existing HTTP/1.0 user agents will
     erroneously change it into a GET request.
imply that POST should be used.  But why not say it explicitly?

On the other hand, the 303 response does have the need to redirect
"POST URL" to "GET NEWURL".  A header in the response should be added
to indicate the new method to be used.  If this header is not in the spec,
it should be added.


>Aside: I believe that if you just output 
>Location: <full URL>
>in a CGI script, the server will send a 302 status code.  To get a 303 status
>code, do
>Location: <full URL>
>Status: 303 See Other

Received on Wednesday, 12 March 1997 08:11:25 UTC