A Beginners Guide to HTTP Response Codes

HTTP response codes help power the internet, from blogs, powerhouse publishers and powerful API’s, they all rely on HTTP response codes as a way for servers to communicate with each other, this includes client (i.e. you!) to server communications, too.

Almost everyone, from your grandmother to your little brother, has heard of a 404 error, check out our’s here. A 404 not found error is of course, when a page is not found by the server, but what’s happening here? When you’re extremely busy at work, looking up LOL catz for some important research and you come across a 404 error, what’s happened is you made a request via a URL, the server which stores the resource receives the request and in turn sends back a response, in this case, a 404 error status code.

lol-cats-error-404-big

Response Codes in Action

Before we go any further, lets look at some live examples, if we look at Dave Naylors blog, we can see a 200 response code is returned, go ahead and try it yourself:

Enter a URL with HTTP protocol, for example https://www.davidnaylor.co.uk/

This time try the following http://www.davidnaylor.co.uk/ notice it’s ‘http’ now rather than ‘https’. If you entered the URL you should have seen a 301 returned, the end URL will have been of course, with the https.

Common Response Codes You Should Know

The following are some of the common response codes you may come across, what they do, why they are important and when you should use them:

20X Response Codes

2XX response codes are known as “successful” status codes, an action has been received and returned successfully, for example this page you are reading now is returning a 200 status code. Yay!

There are of course other 2XX responses but they are not seen quite as often, for example the 204 response code is commonly seen when deleting through an API; signalling the deletion was successful, from a database for example, but there was no content to return.

30X Response Codes

3XX status codes are known as redirect status codes; when a client is moved to a new location (i.e. from one URL to another), for example when a product has been discontinued and you are re-routed to the nearest category. 3XX response codes are where it gets a little more interesting, at least where the SEO/online marketing bod is concerned, here’s the breakdown:

40X Response Codes

4XX response codes are known as client errors, these are status codes where a client shouldn’t have access or have accessed the URL in a certain way. Add https://www.davidnaylor.co.uk/oops to the little tool above and you’ll see the code returned. Now, let’s take a look at some of the common response codes you’ll come across:

50X Response Codes

5XX status codes are known as server errors, this is where the server has failed to deliver a valid request, this could be an error in the code for the route URL you are trying to access. I’ve listed here, arguably the 2 most common you’ll encounter.

So that’s it! Hopefully you’ve found this crash course useful. Next time we’ll cover HTTP Request Methods. Follow us on Twitter to keep up to date. @Bronco


We'd love to hear from you!

If you think Bronco has the skills to take your business forward then what are you waiting for?

Get in Touch Today!

Discussion

Add a Comment