|
|
|
|
|
by akvadrako
3236 days ago
|
|
> Suppose you make a call to an API and it returns 5xx because you provided a parameter value that is valid in the URL or payload but invalid in the app That is wrong. Client mistakes should get 400-level error codes. A 200-level code indicates the request completed successfully, which it didn't. There is no difference between an "HTTP server" and an app. They are often the same thing, like when using Apache to serve files from disk. > I'm not arguing that one shouldn't use HTTP status codes, I'm arguing that they should be used only for the standard meaning of the code Of course you should use the error codes correctly! Don't return a 200 code when the request failed. |
|
The request didn't fail, it simply followed application logic and returned a successful response indicating the nature of the application logic to the client. That is not an error condition, it's just application logic.