What Are HTTP Status Codes - Everything You Need To Know [Ultimate Guide]
# website development# ultimate guide

What Are HTTP Status Codes - Everything You Need To Know [Ultimate Guide]

In short, HTTP status codes are short codes that a server will give to a web page to help website developers and website customers understand what's wrong, whenever something goes wrong!

These codes aren't part of the website's original content, but are instead, generated on the fly to help identify errors.

Each code has a meaning, and potential causes behind them, some error codes are more common than others.

This article will cover everything you need to know about HTTP status codes, plus more!

Let's deep dive into these!

What are HTTP Status Codes?

what are http status codes

Have you ever loaded up a website, tried to complete some action only to find that you end up on some kind of error page?

It happens from time to time, and chances are, the error page will have a HTTP status code on that page followed by a brief summary of it's meaning...

Typically, you'll get a status code when something goes wrong, and the most common type of HTTP status code is the 404 page not found code.

You're likely quite familiar with this type of code, it's usually triggered when the page you're trying to visit no longer exists, or you've mistyped the URL into the domain name.

Some websites will have a fancy 404 page not found design and UI associated with them, whereas others might be more stripped back, back to basics if you will.

Understanding The Different Response Status Codes - The Classes

understanding different http status codes

HTTP status codes are split up into different classes.

Why?

Because there's a lot of codes, and it would be almost impossible to remember every single code and the meaning, so the different classes help identify a status code by the first number.

Response Code Classes

  1. Informational responses - 100 to 199 (100s)
  2. Successful responses - 200 to 299 (200s)
  3. Redirects - 300 to 399 (300s)
  4. Client errors - 400 to 499 (400s)
  5. Server errors - 500 to 599 (500s)

As you can see, there's a couple of hundred different possible HTTP status codes that you could find, so each code is broken down into a class.

Each class defines a set of error codes and are put unto an umbrella category, for instance, the 404 page not found error we discussed...

Well, that comes under the "Client error".

Why?

Because it's a problem that can likely be solved by you, the end user, and isn't a problem that others might be experiencing.

Class 100s: Informational responses

The first HTTP status code class is related to informational responses, as the name implies.

You might come across one of these codes for when a server is letting you know that something is still in process for some reason, it's not an error as such, it's simply just some information for you.

  • 100 Continue - a slightly odd one here, but the meaning of this is that the server has received your browser's headers and is now ready for the request body to be sent
  • 101 Switching Protocol - the browser you're using has asking the server to change protocols, and the server has complied with this request
  • 103 Early Hints - this code returns some response headers before the rest of the server's response is ready

Class 200s: Successful responses

The second set, and by far, the friendliest set of codes that you might come across is the informational responses class.

Chances are, if you're a user browsing a website, you won't see these HTTP status codes printed to the screen, but instead, you might see a green alert box with a success message.

Or something similar, because that's what the class suggests...

Successful.

Here's some examples of the different successful codes you could come across:

  • 200 OK - typically used for when a request succeeded, and usually you'll find some alert box on the screen with a success message
  • 201 Created - as the name implies, you could come across this when you've created a user account on a website
  • 202 Accepted - this HTTP status code is usually used as a simple way of indicating the outcome of a request

Class 300s: Redirects

Have you ever loaded up a domain URL only to find that it redirects elsewhere? Well, that's what redirects are.

These codes typically aren't outputted to the screen, but instead, are more of a functional set of codes that redirect the user somewhere.

The two most common types of redirects are the 301 redirect and 302 redirect codes, and are often used in SEO redirection for websites, especially when you change page URLs.

We'll take a look at three of the redirect class codes below...

  • 300 Multiple Choice - the request has more than one choice, so the browser's user-agent should choose one of them
  • 201 Created - as the name implies, you could come across this when you've created a user account on a website
  • 202 Accepted - this HTTP status code is usually used as a simple way of indicating the outcome of a request

Class 400s: Client errors

Client errors are typically issues related to you, the end user, and aren't likely related to the server in question.

Some of the HTTP status codes in this class are probably familiar to you, such as the 404 error, which is used when a page can't be found.

But there are some other client errors that you could experience, such as:

  • 400 Bad Request - this error code is used for describing a bad request, or, a general error with the request that has been sent
  • 401 Unauthorized - as the name implies, you're unauthorized, and will need to authorize with the server again, typically by logging in or authenticating yourself

Class 500s: Server errors

Whenever there's something wrong with the server, such as a code error, the server has to hand out one of these errors.

If the server didn't do this, you, the end user could end up experiencing some funky behaviour on the web page.

So how does the server handle this?

By handing out one of the following (there are others)

  • 500 Internal Server Error - this is the most common type of error, and is used as a way of providing a generic error
  • 503 Service Unavailable - if the server isn't available, or something is wrong, such as incorrect file permissions, you could see a screen with this HTTP status code

Conclusion

http status codes conclusion

HTTP status codes are everywhere, if you're unfamiliar with them, hopefully this article has helped you understand a bit more about them.

If you liked this post, and would like to see more content like this, feel free to share this post!

More posts

Website uptime monitoring for e-commerce stores what you need to know

As an e-commerce store owner, you understand the importance of having a reliable and efficient online presence. Let's look at why website uptime monitoring is so important for e-commerce. Read more today.

Read more
The role of website uptime monitoring in ensuring customer satisfaction

As a business owner, ensuring customer satisfaction should be a top priority. One key aspect of customer satisfaction is having a reliable and efficient online presence, which is where website uptime monitoring comes in.

Read more
Maximizing the efficiency of your website uptime monitoring strategy

As a website owner, uptime monitoring is crucial to ensure that your website is always available and functioning properly. In this article, we'll discuss how to maximize the efficiency of your website uptime monitoring strategy, including the use of tools, setting up alerts, and optimizing your website's performance.

Read more

Subscribe to our PRO plan.

Looking to monitor your website and domains? Join our platform and start today.