Software⏱️ 3 min read📅 2026-06-11

How to Fix Error 400 Error – HTTP Error 400. The size of the request headers is too long

HTTP Error 400: Request headers too long due to excessive character limit in web.config and IIS settings.

Quick Answer: Adjust the MaxFieldLength, MaxRequestBytes, and UrlSegmentMaxLength registry values or update the web.config file to increase the content length limits.

HTTP Error 400 occurs when the size of the request headers exceeds the maximum allowed limit. This error affects users who send GET requests with large character counts, exceeding the configured limit of 15,861 characters.

This issue can be frustrating for developers and users alike, as it prevents them from sending complete requests. Fortunately, there are steps you can take to resolve this problem.

🛑 Root Causes of the Error

  • The primary cause of HTTP Error 400 is when the request headers exceed the maximum allowed size limit configured in the registry or IIS settings.
  • An alternative reason for this error could be due to the web.config file not properly configured with the correct values for request filtering.

✅ Best Solutions to Fix It

Increasing the Maximum Request Header Size

  1. Step 1: Open the Registry Editor and navigate to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Config\System\AppSettings key.
  2. Step 2: Find the MaxFieldLength DWORD value and increase its size from 65534 to a higher value, such as 131072 or more, depending on your needs.
  3. Step 3: Restart the IIS service for the changes to take effect.

Configuring Web.config File

  1. Step 1: Open the web.config file and locate the requestFiltering section.
  2. Step 2: Update the maxAllowedContentLength, maxUrl, and maxQueryString values to a higher value than the current limit of 2147483647.
  3. Step 3: Restart IIS for the changes to take effect.

✨ Wrapping Up

To resolve HTTP Error 400, you can either increase the maximum request header size by modifying the registry settings or configure the web.config file with higher limits. By following these steps, you should be able to send GET requests with large character counts without encountering this error.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions