Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: