Understanding HTTP 400 Error Codes
These days, encountering errors on the web isn’t as common as it used to be. However, you’ll still run into problems on your site occasionally. Unless you understand what each HTTP error code means, you may end up losing traffic because of it.
The good news is that each HTTP 400 code is specific to a certain type of error. If you know what the underlying problem is, you should be able to circumvent or fix it (if possible). This ensures that both you and visitors to your site will have a smooth and trouble-free experience.
In this guide, we’re going to walk you through many of the HTTP error codes within the 400 family. We’ll talk about what each code means, why it occurs, and how you can fix it. Let’s get to work!
Types of HTTP 400 Errors
At the moment, there are over 20 types of 400 HTTP error codes. Don’t let that scare you, though – most of them are fairly rare. However, it can be handy to know what they each mean, or to simply have a cheat sheet (like this guide) available when needed.
Before we go any further, let’s talk about what 400 errors actually are. The 400 family of codes are issues that originate on the client’s end of a connection. That means your server isn’t at fault when you run into any of these codes.
Now, let’s look at each 400 error code in turn, and discuss what it means – and what to do about it if a solution exists.
400 Bad Request Error
This is one of the most common types of 400 errors, because it has a lot of potential causes. Essentially, the 400 Bad Request error will pop up when your web server can’t process a request body due to some mistake on the client’s end. This can happen because of an invalid URL, malformed syntax, and other reasons.
Since there are so many potential causes for a bad request error, there are also a lot of fixes for it. For example, you can check for misspellings in the URL you typed, clear your cookies, or empty your cache. If none of those methods work, the error will often clear up on its own if you simply try loading the website at a later time.
In contrast to the previous issue, the 401 error code is highly specific. It will only appear when your client isn’t authorized to access the URL you’re attempting to visit.
In practice, this can happen for several reasons. Your IP address might be banned from that website, which some sites do automatically to protect themselves against attacks. You may also need to clear your cookies to resolve the authentication error, and then log out and in to the website again.
Should that fail, emptying your cache might also do the trick. However, if the error persists, you might have to contact your web host to see if your IP has been banned from accessing the site for some reason.
402 Payment Request
The 402 Payment Request code is one of the most interesting in the 400 family. You should almost never run into this error in the wild, because it’s reserved for use with micropayment schemes, which aren’t widely available yet.
In practice, some services use this error code for different reasons. For example, the Google Developer API uses it to limit the number of daily requests you can make from its API. Still, this isn’t an error that you should ever need to address personally.
The HTTP 403 code is an error you’re likely to run into at some point, because it has many possible causes. 403 Forbidden tells you that the server is refusing your requested resource for one reason or another, and the underlying cause is on your end.
For example, if you need authentication to access a specific page, the server might respond with a 403 Forbidden error code. The same thing might also happen if someone tries to access your website’s directory, and you’ve blocked listing for it.
In any case, there’s usually a good reason you can’t access the resource you want. So this is a type of error you might not be able to circumvent.
404 Not Found
HTTP status code 404 is by far the most common of all the errors in this guide. When you run into this error, it means that the user agent was able to establish a connection to the site’s server, but couldn’t find what it was looking for.
In other words, error 404 is what occurs when you try to visit a page that doesn’t exist. That usually happens because the URL was mistyped, the page changed its address, or the website you’re trying to visit isn’t there anymore.
405 Method Not Allowed
From this point onwards, we’re moving into the realm of more obscure 400 error codes. Error 405, for example, occurs when your client connects to a server, but the request can’t be completed because you’re using the incorrect HTTP method.
Although this error is fairly uncommon, you may run into it if you’re using a Content Management System (CMS) and you make changes to its PHP code. In our experience, it can also be the result of installing new plugins, modules, or extensions. If this error persists, we recommend restoring your site to a recent backup, since tracing its source can be very complex.
406 Not Acceptable
In practice, this error is fairly similar to HTTP status 405. Error 406 will occur when your client requests a response using an Accept header, and the server on the other end can’t fulfill it.
To put this in layman terms, when your client makes an Accept request, it specifies what type of character set, language, or file type it needs. If the server can’t provide a response body that ‘matches’ that request, you’re likely to see the 406 Not Acceptable error.
Just as with error 405, troubleshooting the cause of this response code can be highly complex. With that in mind, your best bet is reverting to a recent backup of your website.
407 Proxy Authentication Required
As far as 400 error codes go, this one is fairly straightforward. It shows up when you try to connect to a server, but your client can’t complete the process because it lacks authentication from a proxy that’s acting as a middleman.
In our experience, the most common cause of this error is when you’re trying to access an incorrect URL that requires specific authorization. If you do have access to a proxy server that you use for your website, however, you may simply need to log into it separately before trying to access the URL once more.
408 Request Timeout
When you try to access a website, your client connects with its server and requests that it send the information needed to display that site. However, sometimes your client won’t make the necessary requests within a reasonable timeframe. That often results in the 408 Request Timeout error.
Since this is a client-side error, your best strategy is simply to reload the page you were trying to access in the first place. The 408 Request Timeout will usually go away on its own, unless your internet connection is experiencing problems.
This is one of the most interesting codes within the 400 error family. It usually occurs when you try to create or modify a folder, but the instructions your client sends to the server conflict with existing rules.
For example, if the server thinks you’re trying to update a file that already exists, but the version you’re putting up is older, that will often result in a 409 error. This may also happen when you’re trying to rename a file, create a directory, and in similar situations. In most cases, you can sidestep the problem by modifying the type of HTTP request that your client makes to the server.
410 error codes are mostly intended for Search Engine Optimization (SEO) purposes. What this code tells you is that the resource you’re trying to access is gone, and it’s probably not coming back.
From the perspective of an end user, the 404 and 410 error codes might as well be the same thing. They both tell you that the resource you’re looking for isn’t there. However, code 410 also lets search engines know that they shouldn’t continue to crawl and list that page.
411 Length Required
This is another example of a highly-specific 400 error code. The 411 Length Required error appears when a client makes a request without indicating the length of its content.
Usually, you won’t run into this error while browsing the web. Instead, the 411 Length Required error tends to pop up when you’re making a request header through an API. To solve it, you may need to modify the request method itself.
412 Precondition Failed
In some cases, when your client makes a request to a server, that request can come with some conditions attached. For example, the request might include an If-Unmodified-Since header, and if the server can’t fulfill the criteria, you’ll see the 412 Precondition Failed message.
This is another example of a client error that most people don’t encounter while simply browsing the web. If you’re working with an API or something similar, you might need to modify your request so the server can meet its preconditions.
413 Payload Too Large
When your client makes a request to a server, it receives data in return. However, there’s a limit to the amount of data that any given server can process at one time.
If you see this error, it means the server can’t or won’t process your request, because it involves too much information. The request itself will need to be simplified if it’s going to work properly.
414 Request-URI Too Long
First, it’s important to understand that a Uniform Resource Identifier (URI) isn’t the same as a URL. To put it another way, all URLs are URIs, but not all URIs are URLs.
Semantics aside, the 414 Request-URI Too Long error usually occurs when an URL is too long for a simple GET request. In these cases, you’ll need to submit a POST request instead.
415 Unsupported Media Type
As far as 400 error codes go, this one is fairly straightforward. Not all servers support every file type. This means that, in some cases, you might try to upload a file only for the end server to reject it. This will trigger the 415 Unsupported Media Type error.
To sidestep this problem, you can try to upload the file in a type the server does support. If that’s not possible, you’ll need to change your server’s configuration so that it supports the file types you require.
416 Requested Range Not Satisfiable
In some cases, a client will make a request for a specific portion of a file, which is referred to as a ‘range’. If that range exists, the server should return it promptly. However, if there’s an error in the request (for example, if it’s asking for part of a file that doesn’t exist) the server will return the 416 Requested Range Not Satisfiable error instead.
This is another example of an internal server error you might run into while working with an API or making highly specific requests to a server. To solve it, all you have to do is modify the range of your request, so the server can fulfill it.
417 Expectation Failed
With HTTP, you can check to see if a server can accept your request before you send it. To do that, you’ll use something called an Expect header. If the origin server can’t accept your request, it will respond with a 417 Expectation Failed error message.
In practice, there are several reasons a server might refuse a request. For example, it might be an issue with proxies or with your client’s permissions. In any case, we recommend clearing your cache and cookies, before trying to connect to the server again.
429 TOO MANY REQUESTS
This error will be returned if our system detects that an excessive number of requests have been made from your IP address.
If you encounter this error, trying the site again after a few seconds should allow you to gain access normally. For any persisting errors of this type, please contact our Support team so they can work with you to ensure that requests from your network can be served properly.
Provide the Optimal Site Experience with WP Engine
One of the easiest ways to avoid running into HTTP error codes is to use a reliable web host. With a solid hosting infrastructure in place, you should be able to avoid server-side HTTP errors and similar problems.
With the right provider, you can also get access to a world-class support team (like ours!), which can help you troubleshoot any HTTP error codes quickly. Check out our plans if you’re interested in providing a better digital experience!