Re: Should the HTTP Method change when following a 303 redirect ?

If I understand this correctly, except for specific protocols defining
other rules, by default, a standard http user agent should use a GET or
HEAD method when following the Location header for 303, as they're the
regular retrieval method ?

Thanks for the clarification !
Pof

Le mer. 22 avr. 2020 à 15:38, Amos Jeffries <squid3@treenet.co.nz> a écrit :

> On 22/04/20 10:41 pm, Pof Magicfingers (Giovanni Olivera) wrote:
> > Hi everyone,
> >
> > I'm reaching out to you to clarify what behavior is expected regarding a
> > 303 redirect.
> >
> > I'm currently discussing about this with the cURL team, and we're not
> > really sure if a user agent SHOULD or MAY change the HTTP method to GET
> > or HEAD when following a 303 redirect.
> > You can read the discussion here :
> https://github.com/curl/curl/issues/5237
> >
> > Reading RFC7231 at section-6.4.4
> > <https://tools.ietf.org/html/rfc7231#section-6.4.4>, it states that :
> >
> >> A user agent can perform a retrieval request targeting that URI (a GET
> > or HEAD  request if using HTTP)
> >> [...]
> >> This status code is applicable to any HTTP method.
> >
> > But it seems unclear if the user agent SHOULD use a GET method when
> > following the redirect,  regardless of the current method used, for a
> > 303 redirect, of it should keep the current method used for the request
> > inducing that redirect.
>
> The Location URL in a 303 is defined for _retrieval_. Only retrieval
> methods can be expected to work on it.
>
> HTTP defined GET and HEAD for regular use, but other protocols may
> define more methods for retrieval. So there is no requirement to use
> GET/HEAD specifically. Those other protocol alternatives may be used if
> the context needs one.
>
>
> Amos
>

Received on Wednesday, 22 April 2020 14:20:16 UTC