As opposed to SOAP, building a REST service gives you a lot of creative freedom. You can choose your own URI scheming, which content types to use, what HTTP verb to send and which HTTP status code to return.
This causes questions to be asked daily: "What URI pattern should my service use?", "Which HTTP status code to respond with in arbitrary situation X?" and "With what verb should I send this arbitrary request?".
Case in point, a quick handful of questions for the past week:
- 404 vs 200 for relative entities, RESTful
- What would be a valid REST approach for a file conversion service?
- REST POST duplicate list item
- When to choose association over query
- Best HTTP code for a failure of an external subsystem
- How to design RESTful API for hierarchical entities
Such questions hardly ever get more than one answer, where OP seems to want to hold their specific situation against someone else to just hear "Just pick any, it doesn't really matter anyway" or "I would use this status code", where the proposed status code is wrong.
A lot of these questions are thus basically opinion-based, where OP will accept the first opinion they hear.
I would like to do something against these questions, as they're hardly any good, often too localized and the answers are generally opinion-based or wrong, based on a misinterpretation of either the REST manifesto or the HTTP RFCs.
There's plenty of lists of HTTP status codes on the web where it is explained which status code or verbs applies to which situations. Can we, for example, create some canonical Q&As where these aspects of HTTP are explained in understandable terms, so any question that asks the same as thousands before them can be closed as a duplicate of one of those canonicals?
REST
tag is not an option, I'm interested in those questions in general.