Error 400: Invalid Request Explained

0
74

If you surf the Internet every day, things are not always the way they should. Occasionally, your browser will display a status code instead of the desired content. While communication between the web server and the client – that is, your browser – is essentially a stateful message transmission, but only if a problem occurs, your web browser window shows you Low or confusing error messages. The screen displaying the HTTP 400 code indicates that there was a problem with your client’s request. We’ll explain the meaning of the error message and give you tips on how to resolve the issue.

What does the Error 400 request mean?

With the status code, the web server returns the request status to the client. If the server returns a 200 message (which you do not normally see when surfing), everything is fine. The request was successful and the requested content was moved. The situation is different from the codes in the 400 and 500 range: This refers to the different errors.

Everything in the ‘100s point to continue and everything in the’ 200s to complete successfully. These usually do not see Internet users as well as everything in the 300 range: In communication, everything is working, but the customer has to take another step. Most of the time these are redirects, but the browser automatically performs and you rarely notice it as the user.

The error messages are quite different: While the group of 500 errors related to server-side errors, everything in the 400 range is due to a faulty request from the client. The most famous is probably the 404 error: Not found. The cause of the message is often the URL is incorrect or the content is removed.

With Error 400, the question “What’s wrong here?” Not so easy to answer. In some form, the requirement itself is incomplete. Internet HTTP protocols are – at least in the opinion of web hosts – not respected correctly, which is why requests cannot be handled. The server explained the request was faulty or even harmful. Therefore, he stopped distributing the site. The reason for the error message is primarily related to the browser being used or to the user’s fault:

  • The wrong URL: Same as 404 error, Incorrect request occurs when user enter incorrect internet address and insert special characters are not allowed, for example.
  • Cookie error: If the cookie in your browser is outdated or faulty, error 400 may also occur.
  • Outdated DNS record: Your DNS cache may still have data pointing to the wrong IP address.
  • Files are too large: If you try to upload very large files, the server may refuse to accept them. This is also rated by the server as an Invalid Request.
  • Headline too long: When communicating, the client and server use the headers where the request is defined. Some web hosts put limits on the length of these headings.

It is therefore not directly apparent from the “HTTP 400 Bad Request” error message exactly where the problem with communication really lies. However, if the web server is targeted using IIS 7.0, IIS 7.5 or IIS 8.0, more detailed information is readable from the status code:

  • 400.1: Invalid Destination Title
  • 400.2: Invalid depth header
  • 400.3: Invalid title
  • 400.4: Title override invalid
  • 400.5: Invalid translation title
  • 400.6: The request content is invalid
  • 400.7: Invalid content length
  • 400.8: Invalid timeout
  • 400.9: Invalid key token

Incidentally, bug 400 does not just happen when browsing in the browser. Other programs, such as mail clients, may receive status codes when communicating with the server.

Fix 400 invalid requests

As with most status codes displaying error messages, in many cases, it’s just enough to reload the site. First of all, if an error occurs first on the website that you can usually call without error, the problem may be temporary. If a new pageview does not directly address the issue, it sometimes succeeds in clearing the browser cache. Your web browser may have just saved a copy of the error message that was displayed.

The wrong URL

The next step to analyze the problem should be to check the URL: If you have entered the address into your browser field, check if not a typo has crept into. If you click on a link, you can also check that spell, or perhaps go to the main page first, and from there visit the desired base.

Invalid cookie

The problem may also be due to outdated or incorrect cookies. To fix this, just delete the corresponding entry in your browser. Now, when you visit the site again, the software will create a new cookie.

The wrong DNS entries

Another solution you can try is to clear your DNS cache. When you surf the Internet, the domain you enter is translated into an IP address – just to connect to the World Wide Web. For this, a name resolution must first be made on a name server. To shorten this process, your computer temporarily stores the collected data in the DNS cache. But the next time you enter a domain name into your browser and the entry is not automatically removed from the cache, the name resolution will take place directly from the cache. If this entry is broken or out of date, the “HTTP HTTP Request” message appears.

To delete the wrong entry, you must delete the entire DNS cache. To do this, call the Windows command prompt and enter the command to empty the cache:

                ipconfig /flushdns

For Mac systems, this command depends on the operating system version. All commands are entered through the terminal:

  • OS X 10.4 (tiger): lookupd-flushcache
  • OS X 10.5 (Leopard): dscacheutil -flushcache
  • OS X 10.6 (Snow Leopard): dscacheutil – flushcache
  • OS X 10.7 (Lion): sudo killall -HUP mDNSResponder
  • OS X 10.8 (Mountain Lion): sudo killall -HUP mDNSResponder
  • OS X 10.9 (Mavericks): dscacheutil -flushcashe; sudo killall -HUP mDNSResponder
  • OS X 10.10 (Yosemite) (10.10.1 – 10.10.3): sudo discoverutil udnsflashcaches
  • OS X 10.10 (Yosemite) (10.10.4+): sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  • OS X 10.11 (El Capitan): sudo killall-HUP mDNSResponder
  • macOS 10.12 (Sierra): sudo killall -HUP mDNSResponder

Problem with HTTP header field

As an internet user: delete cookies and reset your browser

HTTP 400 error occurs even when the HTTP header is too long. In principle, the title does not have a size limit. However, it is possible that the target server has set limits. The title includes some fields in which queries and feedback are determined. If both digital participants have adjusted the parameters, the requested data will be exchanged. If this does not work, an error message will appear. Since it is a communication between your browser and the web server and 400 errors are usually caused by problems with the client, the browser may be responsible for the error. The best way to check if your default browser is causing the problem is to temporarily switch to another browser.

If the page request is active in your test browser, return to your favorite web browser. There you delete your cookies in the first step (if you have not already done so in an attempt to solve the problem before). This time, you are not only deleting a targeted cookie but for security purposes. Reason: Cookies are moved in the header, because that’s how the web server learned about your previous visit. If the browser includes too many items in the request, the title may exceed the length limit.

If the solution you tried is not successful, it means completely reinstalling the browser or resetting it to factory settings. Depending on your browser, there are many different ways to reset. In Firefox, you can access support for troubleshooting by typing about: support. Incidentally, here you will also find a wealth of information that will help you discover any bugs in the software. Even if you contact the support team, this information is important. On the page, you can also see a button that you can “clean up Firefox”. First, a click saves your current settings and then deletes gadgets and settings.

In Internet Explorer, click Internet Options under “Advanced” button “Reset” or “(in IE 6) Restore Defaults”. The Microsoft browser gives you the option whether you also want to delete your personal settings when resetting. Because Internet Explorer is one of the settings and the cache and cookies should also to delete them.

For Chrome, you’ll find the Reset feature in System Preferences. Browsers retain your personal information such as passwords and history stored, but if not, restore everything to its original state. Close the browser and reboot for the changes to take effect.

Be webmasters: set limits

If you are the webmaster and have complained about Error-Code-400, this may help to change the server settings. To prevent Internet users from seeing error messages due to oversized HTTP headers, you can increase the limit. But you should keep in mind that higher limits increase the risk of bad requests. In the HTTP 1.1 documentation, the Internet Technical Working Group (IETF) also resolved 400 invalid request issues and indicated the risk of exceeding the limit (smuggling attack):

MUST respond with appropriate 4xx status code (Client Error). Ignoring search for header fields will increase the vulnerability of the server to require smuggling attacks (Section 9.5). “

Hypertext Transfer Protocol (HTTP / 1.1): Syntax and message routing

Contact us

Unfortunately, no problem-solving variation can lead to a goal. Then you should seek help elsewhere. In principle, you have two contacts, depending on whether you only see HTTP-400 errors on a particular page or across multiple sites or all. If the error only appears on a specific page and previous attempts to fix the problem, you can contact the webmaster of the site – or at least try it. In another case (you can no longer surf the web regularly, because Bad Request 400 will be permanently displayed), you should contact your Internet provider, Even if the problem is not really with Suppliers, support groups can help you.

Ideally, in both cases, you give your contacts as much information as possible. This includes, on the one hand, all the efforts you have made so far to eliminate the problem of fatigue. On the other hand, you also enter data for your system: Which operating system do you use? What browser do you use to surf the Internet? Do you have any extensions for this setting? Do you use a firewall or do you use a proxy to access the internet? All this information will help both the support team and the webmaster solve the problem. So you can surf the Internet again without being disturbed without the “400” error displayed.