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!
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.
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.
100
to 199
(100s)200
to 299
(200s)300
to 399
(300s)400
to 499
(400s)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.
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 sent101 Switching Protocol
- the browser you're using has asking the server to change protocols, and the server has complied with this request103 Early Hints
- this code returns some response headers before the rest of the server's response is readyThe 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 message201 Created
- as the name implies, you could come across this when you've created a user account on a website202 Accepted
- this HTTP status code is usually used as a simple way of indicating the outcome of a requestHave 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 them201 Created
- as the name implies, you could come across this when you've created a user account on a website202 Accepted
- this HTTP status code is usually used as a simple way of indicating the outcome of a requestClient 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 sent401 Unauthorized
- as the name implies, you're unauthorized, and will need to authorize with the server again, typically by logging in or authenticating yourselfWhenever 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 error503 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 codeHTTP 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!
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 moreAs 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 moreAs 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 moreLooking to monitor your website and domains? Join our platform and start today.