Hacker News new | ask | show | jobs
by fleetfox 3107 days ago
What a horrible advice, just because you are too lazy to return correct status code someone who consumes the api has to do twice the work.
1 comments

Not at all. Some languages and libraries don't handle non-200 status codes nicely, they may raise exceptions for each code, or maybe not. For example, Python's basic urllib library makes it easy to get 200 responses but a hassle to get anything else (you need to wrap it in a try/except).

For some APIs, it definitely does make sense to use proper status codes, but for others, it's like fitting square pegs into triangular holes.