resthttphttp-status-codesrfchttp-1.1

REST: correct response status according RFC 2616 HTTP/1.1 spec?


I have skimmed over the HTTP/1.1 protocol spec at RFC-2616 and I am trying to understand which status code should be returned when a particular REST method is invoked. As far as I have studied the protocol (links), I tried to parse REST methods to the correct status code:

Is my "table" correct (especially the statements with the quotation marks ?? Is right that only GET should return the request itself in the body and the rest of methods just an URI link to an amended resource (new added, modified..) included in the header?

Is my understanding correct and does exist another source describing REST methods officially which is recommended (or are we "obligated") to follow? I am quite confused of wide range of sources giving me a bit different answers to each method as well of this really verbose RFC-2616 protocol.

The best would be the existence of a table describing briefly and clearly all these 5 methods with possibilites of status returned, body content and headers.


Solution

  • From RFC 7230

    This HTTP/1.1 specification obsoletes RFC 2616

    So any attempt to work out patterns for status codes should start from there

    Is my "table" correct

    Not really; take a look at Kropat's (unofficial) flow charts in Stop Making it Hard.