9672Re: [rest-discuss] 30x Status codes
- Oct 2, 2007Stefan Tilkov wrote:
> On Oct 2, 2007, at 4:16 PM, Peter Lacey wrote:It does, but the proper use of HTTP frequently requires multiple trips.
>> The 303 status code is a good way
>> to canonicalize your resources. You can make them available through many
>> URIs, but only have one "real" URI per representation.
> Which of course means an extra client/server roundtrip, which may or
> may not be acceptable.
> Stefan Tilkov, http://www.innoq.com/blog/st/
Certainly redirects are common enough. And, if you want to treat them
differently, there's also a few 2Xx responses after a POST/PUT that
might encourage a client to go back to the server. HEAD and OPTION
usually imply a future trip to the server, too. Also, in the case of a
GET, the first trip is pretty lightweight; headers only. Similarly,
form-based links that allow compliance with HATEOAS (God, I hate that
term) requires an extra trip. Want to look up a person? Can you
construct a link, e.g., http://example.com/users?first_name="Stefan" ?
Not without, getting a form first. Finally, 303s mean a cache can store
less information, and perform the redirection on the server's behalf.
Ultimately, though, circumstances will help you decide whether the
expense of a 303 outweighs simply returning the resource.
- << Previous post in topic Next post in topic >>