The 400 Bad Request error is an HTTP status code indicates that the request you sent to the webserver was malformed , in other words, the data stream sent by the client to the server didn't follow the rules. It means that the request itself has somehow incorrect or corrupted and the server couldn't understand it. The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method . Therefore, it prevents the website from being properly displayed.


How do I fix a HTTP Error 400: Bad Request?

There are a number of different causes for a 400 Bad Request Error . It might be a malformed request syntax, invalid request message framing, or deceptive request routing . In most cases, the problem is on the website itself, and there's not much you can do about that. This error appear differently on different websites like the following:


Error Description
Bad Request: Error 400
400 Bad Request
HTTP Error 400 - Bad Request
Bad Request - Invalid URL
HTTP Error 400. The request hostname is invalid.
Bad Request. Your browser sent a request that this server could not understand.

Fixing Bad Request: Error 400

To fix a 400 Bad Request error it is best to start diagnosing the issue from the client side itself. Complete the steps outlined in this section to help diagnose and correct the error.

  1. Check for errors in the URL.
  2. Clear Browser Cache and cookies.
  3. Clear DNS Cache.
  4. Check your File upload Size.
  5. Deactivate Browser Extensions.
  6. Contact the site owner to report the 404 error.

Check for errors in the URL

Check the URL and make sure it is spelled correctly or the link that was clicked on points to a URL with a specific kind of mistakes in it, like a syntax problem . It can be very easy to include unwanted characters in the URL while entering it manually in the browser. Check spelling , hyphens, page extension, etc. Also, make sure they're separated with forward slashes. Specifically, check for extra, typically non-allowed characters in the URL like a percentage character (%). Once you're sure the URL is correct, try to access it again in the browser. If you're still getting the 400 Bad Request error it's time to go for next step.

Clear Browser Cache and cookies

When you browse through the internet and visit different sites, your browser saves several contents and data in temporary storage . If any locally stored website files have been corrupted, this can cause a 400 Bad Request error to be returned instead of the expected website page. To get rid of the stuff you should clear the cache from time to time. There are numerous ways to clear cookies , with each browser using a slightly different method.

Enter the following in the Chrome browsing bar:


chrome://settings/clearBrowserData
  1. Select Advanced tab:
  2. Select "All Time" from Time Range to clear your entire cache.
  3. Select the following:
Browsing history.
Download history.
Cookies and other site data.
Cached images and files.
  1. Click "clear data" button.
  2. Exit/quit all browser windows and re-open the browser.

clearBrowserData

For Android:

  1. Tap Chrome menu >> Settings.
  2. Tap (Advanced) Privacy.
  3. Select "All Time" from Time Range to clear your entire cache.
  4. Check Cookies and Site data and Cached Images and Files.
  5. Tap Clear data.
  6. Exit/quit all browser windows and re-open the browser.

Clear DNS Cache

Your Domain Name System cache( DNS cache ) stores the locations (IP addresses) of web servers that contain web pages which you have recently viewed. Normally this is not a problem, and accelerates browsing experience . However, when you are developing a web site or configuring domain settings, your computer's DNS cache can get in the way, preventing you from accessing the corresponding website. If you encounter a 400 Bad Request error codes, you may need to clear your DNS cache. After you clear your DNS cache, your computer will query nameservers for the new DNS information .

To clear the DNS cache on Windows, follow these steps:

  1. Click Start, click Run, type cmd, and then press Enter.
  2. In the Command Prompt type ipconfig /flushdns and press Enter.
  3. The DNS cache is now clear.

Clear DNS Cache

Check your File upload Size

If you're trying to upload a file to a website that's exceeding the server file size limit , you'll encounter a 400 Bad Request error. You can test this out by uploading different, much smaller files first and check whether this resolves the issue. If this is successful then the initial file is probably too large and you'll need to find some way to compress it before uploading it again.

Deactivate Browser Extensions

If you are encountering 400 Bad Request error , it may be caused by Browser Extensions that you have installed in your browser.

Uninstall Chrome Extensions

  1. Enter the following in the Chrome browsing bar:
chrome://extensions
  1. Chrome will display your extensions in a grid.
  2. To delete an extension, click the Remove button.
  3. Confirm by clicking Remove.

Chrome Extensions

Contact the site owner to report the 404 error

It's possible that the 400 Bad Request error actually isn't anything wrong from your end and it's something they (site owner) need to fix, in which case letting them know about it would be very helpful to solve this issue.



NEXT.....What is Deprecation?