3 ms·
If in doubt, I'm a Teapot serves well ;) What's the HTTP error code for "ambiguous input, please select from one of the following unambiguous suggestions"? Ju
by buro9 15y ago
If in doubt, I'm a Teapot serves well ;)
What's the HTTP error code for "ambiguous input, please select from one of the following unambiguous suggestions"?
Just returning an error isn't helpful, you want to help them resolve it. So you want to return something, and this isn't success (in an application sense) as you didn't do what they asked of you, you're doing something else. But it IS success in HTTP terms, the request made it to the server, got processed fine, and came back fine.
Application codes != HTTP codes.
- StavrosK 15y agoIt's debatable whether the application is entirely separate from the RPC layer. For example, when writing a RESTful API, would you really want the server to respond with 200 for everything, even for "Resource not found" errors? In web applications, HTTP codes and application codes are quite integrated. Of course, you do need some extra error info, as HTTP error codes can't possibly cover every error in your app, but 422 with extra info as a catch-all sounds like a reasonable compromise.