Support

Find answers, guides, and tutorials to supercharge your content delivery.

400 Bad Request Error

Updated on August 4, 2022
400 Bad Request Error

Do you want to access a page, but your browser displays a status code instead of the content you want? When you encounter a 4xx family status code, it signals that something went wrong with your client's request. Today, we are specifically dedicated to the 400 Bad Request error. We'll explain why the error message occurs, what it means, and give you tips on solving the problem.

What is a 400 Bad Request error?

The 400 Bad Request error is an HTTP response status code that indicates the request cannot be completed. As with all 4xx errors, this is due to a perceived client error, which prevents the receiving server from processing the bad request. The 400 Bad Request error thus indicates that the client's request itself was incorrect in some way. The web server considers that the Internet protocol HTTP was not followed correctly, so the request cannot be processed. Therefore, the server has interpreted the request as malicious or erroneous. As a result, it has prevented the website from being delivered.

Many factors can contribute to the server interpreting the request as bad. For example, according to RFC 7231, this can occur because of malformed request syntax, invalid request message framing, or deceptive request routing.

The HTTP response status code will always remain the same, but the exact error page received will vary depending on the requesting client (e.g. web browser) and responding server. You may see the 400 Bad Request error in one of the following formats:

400 Bad Request
HTTP Error 400. The request hostname is invalid.
Bad Request. Your browser sent a request that this server could not understand.
Bad Request – Invalid URL
HTTP Error 400 – Bad Request
Bad Request: Error 400
400 – Bad request. The request could not be understood by the server due to malformed syntax. The client should not repeat the request without modifications.

Although each format may be very slightly, they all mean the request cannot be successful until the client makes a modification and fixes the cause of the error. However, it is important to consider that even though the 400 Bad Request error is classified as a client error, it is still possible the issue originates from the responding server.

Causes of the 400 Bad Request Error

In most cases, the error message can be related to a mistake made by the user or the browser.

Wrong URL

It sounds trivial at best, but the 400 Bad Request error can occur because users enter the Internet address incorrectly and, for example, insert illegal special characters.

Outdated or corrupted cookies

If files in the browser cache are corrupted or problems with expired/corrupted browser cookies, this can cause a 400 Bad Request error.

Outdated DNS data

If the locally stored DNS data is not synchronized with the registered DNS information, this can lead to a 400 Bad Request error.

HTTP headers too long

In the header of the client, the request is defined. It may happen that the server has set a limit regarding the header length. If the header exceeds the server's set limit - i.e. it is too long - a 400 Bad Request may occur.

File size limit

The server can set a file size limit in addition to the header limit. If you want to upload particularly large files, the server may refuse to accept them, leading to the 400 Bad Request error message.

Fixing a 400 Bad Request error

It is best to start diagnosing the issue from the client side to fix a 400 Bad Request error. This means troubleshooting from the device making the request, such as your web browser. Begin by completing one step at a time before making the request again:

1. Reload the page

This is a good tip for starting the troubleshooting process for most status codes. Especially when the error occurs for the first time on a web page, the problem may only be temporary, and reloading the page will already lead to success.

2. Verify the URL is correct

One of the most common reasons for a 400 Bad Request error is an incorrectly entered URL. Fortunately, this is also easy to fix. Make sure no typo has crept in if you have entered the address yourself. For special characters, make sure that they are valid URL characters and that they are encoded correctly.

3. Clear your browser's cookies

If you are using the Chrome browser, you can clear your cookies by clicking on the three dots in the upper right corner. Select More Tools > Clear Browsing Data. Regarding the time period, select All Time in the drop-down menu and then go to Clear Data. Please note: Deleting cookies may result in a few of your settings being deleted along with the cookies, and you will need to log in to your Google account again. So make sure beforehand that you check the recovery settings for your account and know your password.

4. Clear your browser's cache

As in the previous step, if you're using Chrome, go to the three dots in the right corner above. Once you click it, head to More Tools > Clear Browsing Data. This will take you to the menu that will allow you to clear all cached images and files. Alternatively, Ctrl + Shift + Del will also take you to the correct location. When you get to this menu, make sure to check the cached images and files box. If you use another browser, read this guide to clear the cache for all popular browsers.

5. Clear your DNS cache

Depending upon your operating system or browser, the method used to flush your DNS cache will vary. Use our detailed instructions on how to clear the DNS cache for macOS and Windows operating systems.

If completing the steps above does not resolve the 400 Bad Request error, you may want to check if any browser extensions or add-ons are the cause. This can be verified by temporarily disabling one extension or add-on at a time before making the request again. If the 400 Bad Request error continues, you will want to contact the website associated with the error.

Summary

The 400 Bad Request error occurs when a server fails to process a request that has been made. In most cases, the 400 Bad Request error is a client side problem and can be attributed to, for example, an incorrectly entered URL or expired cookies. If you encounter a 400 Bad Request error, try the solutions described in this article. By doing so, you should quickly be able to access the desired website again.

Provided that you have exhausted all the troubleshooting steps on the client side and the problem cannot be fixed, it can be a server side error. This happens occasionally. However, in this case, there is not much you can do. Your only option here is to contact the website where the error occurs and try to reload the web page at regular intervals.

KeyCDN uses cookies to make its website easier to use. Learn more