RESTful Web Services encourages the use of HTTP 303 to redirect clients to the canonical representation of a resource. It only discusses topic in the context of HTTP GET
.
Does this apply to other HTTP methods as well? If a client attempts a HTTP PUT
or DELETE
to a non-canonical URI, is it acceptable (and/or recommended) to return HTTP 303? What is the best practice and why?
I just discovered an interesting section in the book. According to page 378 section
302 ("Found")
:In other words, HTTP 302 was split into HTTP 303 and 307. Next, on page 380 section
307 ("Temporary Redirect")
:In other words, HTTP POST, PUT, DELETE are legal on HTTP 303, 307. The above paragraph explains the expected behavior.
That being said, I'm quoting the book here, not the HTTP specification (which is suspiciously silent on the expected behavior).
Source: http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-21#section-7.4.4