How to fix 400 Bad Request error: 8 easy methods

The 400 Bad Request Error is an HTTP status code that describes an error caused by an invalid request. Therefore, the server cannot understand and process it. Most HTTP 400 Bad Request errors are caused by malformed request syntax, invalid request message framing, or deceptive request routing.

If you are browsing the Internet and you come across this error, it is possible to find the solution to the problem easily. However, there are several times when the error comes from the website server. In this case, only the site owner can fix the problem.

This tutorial will discuss eight methods to resolve a 400 Bad Request error. We will also look at variations of the HTTP 400 error message and its possible causes.

Error code400 Bad Request Errorbug typeThe client’sVariations of the errorHTTP Error 400
HTTP Error 400 – Bad Request
HTTP Error 400. The request hostname is invalid
HTTP Status 400 – Bad Request
400 Bad Request
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.
400 Bad Request. Request Header Or Cookie Too Large
Bad Request – Invalid URL
Bad Request – Error 400
Bad Request – Your browser sent a request that this server could not understandCauses of the errorBad URL syntax
File too big
Faulty cookies or cache
DNS problems

Variations of the 400 Bad Request error

As an HTTP status code, the 400 Bad Request error tells users why they can’t access a web page. With that said, the error message may vary or not display the actual error code.

Here are some of the variations of the 400 error message that you may encounter:

  • HTTP Error 400
  • HTTP Error 400 – Bad Request
  • HTTP Error 400. The request hostname is invalid
  • 400 Bad Request
  • 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.
  • 400 Bad Request – Request Header Or Cookie Too Large
  • Bad Request – Invalid URL
  • Bad Request – Error 400
  • Bad Request – Your browser sent a request that this server could not understand

400 Bad Request error in different browsers

Like the 400 Bad Request Page, the 400 Bad Request Page is customizable. For example, Google has a custom 400 Bad Request error page that looks the same in all web browsers.

However, if the site does not have a custom error page, the web browser will display the default one. This is what the HTTP 400 Bad Request status code looks like in different browsers:

See also  How to Create a MySQL User and Grant Privileges: A Beginner's Guide

Google Chrome

In the case of a 400 Bad Request, Chrome will display an error icon with the text The website does not work followed by If the problem continues, contact the site owner. Below you will find the HTTP ERROR 400 at the bottom of the message.

Microsoft Edge

Microsoft Edge has an almost identical design to Google Chrome, with the text HTTP ERROR 400 on the bottom.

Opera

HTTP 400 Bad Request Error in Opera displays the same text as Google Chrome. The only difference is the icon, since Opera uses its logo.

MozillaFirefox

Mozilla Firefox will display a blank page when you try to access a website using incorrect syntax. There is no text indicating that an HTTP 400 Bad Request error has occurred, which makes it more difficult to identify the problem.

Safari

Like Mozilla Firefox, the browser will appear blank with no indication of the HTTP 400 Bad Request error.

Causes of the 400 Bad Request error

When you try to access a website, your computer sends a request to the web server. The request is then processed and returns the page you want.

The 400 Bad Request error occurs when the server cannot understand the request. Therefore, it doesn’t process it and sends you the error code instead.

In most cases, client issues trigger the error. Some common causes of the 400 Bad Request error are:

  • Malformed URL syntax: URL may contain invalid characters such as {, }, . A poorly encoded URL can also contain misused ASCII characters, such as double percent characters.
  • large file size: Web pages have a file upload limit. An attempt to upload a file that exceeds this limit can be considered a bad request and trigger the HTTP error status code 400.
  • Corrupted browser cache or cookies: Expired cookies or corrupted browser cache can interfere with the request and cause the error. This commonly happens on login pages, like the one in WordPress.
  • Bad DNS cache: If the website has been moved to a new domain name or web host, the data in your operating system’s DNS cache may be invalid.

How to fix the 400 Bad Request error

The first action we recommend is to reload the page. If that doesn’t work, then you should try the following methods.

1. Check the domain address

One of the most common reasons for the HTTP status 400 bad request error is a bad URL. This can include a misspelled URL, malformed syntax, and illegal characters in the URL.

It’s easy to misspell a URL, so be sure to check the spelling of your domain name. If the URL contains a directory path, file name, or query string, watch out for special symbols like the hyphen (-) or percent character (%).

See also  How to unzip or create archives via SSH connection

For example, /tutorials is the correct domain name. if you write /%tutorials in the URL bar with an extra percent character will result in a 400 Bad Request error.

A poorly encoded URL can also cause this error. URL encoding converts characters to characters ASCII to make them transferable on the Internet. For example, one of the most common encodings is to substitute the space by %twenty.

However, a URL can be poorly encoded and therefore contain incorrect syntax, such as double percent (%%) characters. If you enter a URL or click on a link that is poorly encoded, you will end up with a 400 Bad Request error.

When you run into a 400 Bad Request error due to a bad URL, use a . Decode the URL and re-encode it to make sure it’s correct.

2. Search for the keyword

There may be cases where you are sure the URL is correct, but the error persists. If you know the title of the article or the website you are looking for, search for the keywords on the website or in a search engine. Sometimes you can even see the title in the URL.

For example, in the URL of https:///tutoriales/how-to-create-a-web-page, you will see the blog title at the end of the URL. If the website has a search feature, type in the keyword to find the item.

You can also use a search engine like Google either bing. To perform a search on a specific site, type if you: followed by the URL of the website and the keyword.

For example, the title is How to create a web page. Therefore, write site: how to create a website.

3. Clear browser cache or cookies

Cookies and the browser cache store data and content from the client’s site to improve the browsing experience.

The browser cache contains website files, such as text and images, to reduce requests to the web server and make pages load faster. At the same time, cookies store the user’s session history and preferences to enable personalized browsing.

However, cookies may expire after some time. Also, both website cookies and cache can become corrupted and cause a 400 Bad Request error.

Also, HTTP status 400 bad request can occur when the web browser sends cookie data that is too large. In this case, the error message appears as 400 Bad Request – Request Header Or Cookie Too Large.

Try clearing your browser’s cache and cookies to fix this issue. If you use Google Chrome, here are the steps to do it:

  1. Click the three dots in the top right corner of Google Chrome and select Setting.
  2. Find the section security and privacy and click Clear browsing data.
  3. In the window clear browsing data, check the options Cached files and images and Cookies Y other site data and use the dropdown menu to select the time period.
  4. click on Delete data and restart Google Chrome to finish the process.
See also  What is DNS and how does it work?

Remember that clearing your browser’s cache and cookies resets your settings and logs you out of the web pages you’ve visited. Also, it will take longer to load websites as the browser will have to retrieve previously cached content.

If cache and cookies were the cause of the 400 Bad Request error, you should be able to visit the website normally again. However, if it doesn’t work, try the next method.

4. Disable browser extensions

Browser extensions can also cause a 400 Bad Request error. This is because these extensions interfere with the request sent to the web server, which can lead the web server to interpret the request as invalid.

Also, browser extensions can affect cookies, causing a 400 Bad Request error. To find out if a browser extension is causing the problem, we recommend disabling all extensions first. Here are the steps for Google Chrome:

  1. Click on the three dots in the upper right corner of Google Chrome. 2. Select More tools -> extensions.
  2. Deactivate all extensions individually by clicking the button.
  3. Update the web page. If it loads normally, one of the extensions is causing the 400 Bad Request error.

After determining that one of the extensions caused the error, it is necessary to identify the exact extension. Activate the extensions one by one, updating the web each time.

If after activating one of the extensions a 400 Bad Request error occurs, you have found the cause of the error. Leave the extension disabled or remove it completely by clicking the button Put off from the extension’s configuration page.

5. Check file size

Attempting to upload a file that exceeds the server’s size limit may result in an HTTP status 400 Bad Request error. Websites often have different maximum file upload limits, so check if the file you want to upload fits within the limit.

If the website doesn’t mention…

Loading Facebook Comments ...
Loading Disqus Comments ...