|
|
|
|
|
by dragonwriter
1433 days ago
|
|
> Thus -- as REST is /the/ canonical "hijack HTTP status codes to mean something clever" paradigm It's doubly not. The REST Architectural style is (1) protocol neutral, rather than specific to HTTP and (2) emphasizes using the underlying protocol, whatever “as is”. > Anyway - I'm entirely with you on the foolishness of using 404 to mean both "your URL is messed up" and "I couldn't find the resource you wanted". But those are literally the same thing. A URL/URI is a “Uniform Resource Locator/Identifier”. “I don't have a matching resource” is a 404 (unless you are distinguishing “I had a matching resource but you missed it and it's not coming back”, which is 410.) While you might use a body message to distinguish “I would never expect to have a resource with that shape URL” from “I have resources with URLs shaped like that, but not that particular URL”, both are within the usual, RFC-defined meaning of the 404 status code. |
|
If you hit an endpoint and get a 404... did you do it wrong? Is my documentation outdated?
Even better: What recourse do you have? how do you figure out the answer?
Your only recourse is to email me. Send me cURL commands and screenshots and sit on your thumbs until I write back.
IMHO the REST folk were blinded by the existing 404 normalcy set up by web servers.
...
personally I think OP's idea isn't great. I think returning 200 and making me parse the response and hoping it's consistent between services is too much work compared to the simplicity of the HTTP response.
Instead, I'd change the default from 404 to 501.