DEV Community

Discussion on: Create Reliable & Easy-to-use APIs with API First Design

Collapse
 
robencom profile image
robencom

I especially appreciate the HTTP status codes part.

Someone where I work, actually told me that other developers would "laugh at us" for using any status code besides 200 OK. He thought that returning result codes (RC) and result messages (msg) is enough info for other developers, and when it comes to status code, he thinks if the request passes through, then it should be 200 OK.

Obviously this is PAINFULLY wrong, and it was more painful because that person was treated like a GOD in the company, and his title had the words "Expert Web Engineer" in it...

Nevertheless, I managed to convince him with proofs from all around the world.

Collapse
 
raphael_jambalos profile image
Raphael Jambalos

Hi Rob! I totally agree with you! When I did API testing for a client, it really annoyed me to see all of their APIs returned HTTP 200, even if there was an error! They just use the presence of the key "error_message" on the response to communicate that there was an error.

I think this is a complete waste of the HTTP code functionality and how a lot of HTTP clients are already preconfigured to handle 200s, 300s, 400s, and 500s differently.