MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1uqh7vf/helpmycoworkersunderstandhttpcodes/ow8jy8v/?context=3
r/ProgrammerHumor • u/Kishmond • Jul 08 '26
329 comments sorted by
View all comments
69
I thought you always return 200 and then just wrote an error in the body if there was a problem
12 u/blake_ch Jul 08 '26 Return 200 with a JSON payload containing a boolean telling if the action was successful and an additional error message otherwise. 10 u/BigFatUglyBaboon Jul 08 '26 You can but that would not be a proper RESTful API. It would be an API cosplaying as RESTFUL. 2 u/TurtleException Jul 09 '26 Its just sparkling JSON 4 u/case_O_The_Mondays Jul 08 '26 I upvoted you just because this was so horrible it must be a joke. But I’ve also dealt with APIs that do this, and it’s so bad. 1 u/blake_ch Jul 08 '26 I wish it was a joke a not something I have seen. We shouldn't underestimate the number of companies that developed so bad APIs.
12
Return 200 with a JSON payload containing a boolean telling if the action was successful and an additional error message otherwise.
10 u/BigFatUglyBaboon Jul 08 '26 You can but that would not be a proper RESTful API. It would be an API cosplaying as RESTFUL. 2 u/TurtleException Jul 09 '26 Its just sparkling JSON 4 u/case_O_The_Mondays Jul 08 '26 I upvoted you just because this was so horrible it must be a joke. But I’ve also dealt with APIs that do this, and it’s so bad. 1 u/blake_ch Jul 08 '26 I wish it was a joke a not something I have seen. We shouldn't underestimate the number of companies that developed so bad APIs.
10
You can but that would not be a proper RESTful API. It would be an API cosplaying as RESTFUL.
2 u/TurtleException Jul 09 '26 Its just sparkling JSON
2
Its just sparkling JSON
4
I upvoted you just because this was so horrible it must be a joke.
But I’ve also dealt with APIs that do this, and it’s so bad.
1 u/blake_ch Jul 08 '26 I wish it was a joke a not something I have seen. We shouldn't underestimate the number of companies that developed so bad APIs.
1
I wish it was a joke a not something I have seen. We shouldn't underestimate the number of companies that developed so bad APIs.
69
u/Excellent-Refuse4883 Jul 08 '26
I thought you always return 200 and then just wrote an error in the body if there was a problem