Re:I've been abusing HTTP Status Codes in my APIs for years
by XCSme on Wednesday July 13, 2022 @11:47AM
(#32084339)
TIL: You can view upvote/downvote count by clicking on the score. I only needed 12 years on SO to find this out...
Re:I've been abusing HTTP Status Codes in my APIs for years
by nayuki on Wednesday July 13, 2022 @11:56AM
(#32084479)
Only if you attained 1000 reputation. https://stackoverflow.com/help/privileges/established-user
While I agree with you, I sometimes misuse 200 OK even for actual errors. Most times because whatever internal library I've used to do the requests have made it hard to parse the error data if it happens (just throws a general exception instead when it encounters a 4XX or 5XX). Or sometimes because the request failing is somewhat expected, but the client library then insists on doing lots of error handling when it fails (logging, alarms, circuit breakers and whatnot), polluting everything.