HTTP Status Code Resources For Building REST API’s

Gerry Kovan
3 min readMay 12, 2019

One of the frustrating things when creating API’s is choosing appropriate HTTP status codes that follow best practices and is consistent with the way it was intended to be used. There always seems to be a lot of debate about what HTTP status code to use for particular situations. There are obviously guiding principles from the HTTP specification, however there is enough ambiguity in the standard for the debates and usage to vary quite a bit. That is why questions and discussions about this topic on sites such as stackoverflow and others have many different opinions and thoughts which can be confusing to developers.

This article provides some good resources that I found useful in order to choose the most appropriate HTTP status codes while building API’s.

HTTP Status Code Flow Chart

The following blog uses an interesting and very useful flow chart approach to help decide on the most appropriate HTTP status code:

An excerpt from the blog:

Choosing a 2xx/3xx/4xx/5xx/1xx response class
Choosing a 2xx/3xx status code
Choosing a 4xx status code
Choosing a 5xx status code

HTTP Status Codes Used By Famous Sites

It is always useful to understand how world famous sites such as google, twitter, github design their api’s. You might as well learn from the best in the business.

The link below provides info for many of the popular APIs on the internet today.

Subway Map Representation of HTTP Status Codes

A subway map representation of HTTP status codes is quite interesting as well. As you navigate the map and select a particular HTTP status code to find out more information, it takes you to the original specification document which I found quite useful.

Conclusion

I created this blog for my own purposes to help me create API’s and maintain consistency while adhering to the standards as best as I can. Although, I have not added anything new to this topic, I believe this blog at least helps to consolidate useful information on this topic in a single spot. I hope others find this information useful as well.

--

--

Gerry Kovan

IBMer, software engineer, Canadian living in New York, husband, father and many other things.