Need help fast? Ask Pulse AI and get instant support.

Go back to homepage

Requests Fail When the Input Exceeds the Maximum Length

Publish Date: SOTI MobiControl
25

Summary

This article explains why HTTP GET requests may fail with a 400 (Bad Request) or 414 (URI Too Long) error when the input exceeds the server's supported length. It also describes how to increase server request limits to accommodate longer inputs.

Related SOTI ONE Platform Products

SOTI MobiControl

Issue Description

Requests containing lengthy input may fail when the input exceeds the maximum length supported by the server. The input can consist of any text or characters, such as a search query containing a long list of values or a value entered in a field, such as a custom attribute.

The same request typically succeeds when the input is shortened, indicating that the issue is related to the request length rather than the input content itself.

Environment

SOTI MobiControl

Symptoms

One or more of the following symptoms may occur when submitting a request with lengthy input:

  • The request fails with HTTP error 400 – Bad Request (Request Too Long).
  • The request fails with HTTP error 414 – URI Too Long.

The browser displays the following error message:

  • Bad Request - Request Too Long
  • HTTP Error 400. The size of the request headers is too long.

    Cause

    The input is included as part of the HTTP request. If the request exceeds the server's configured size limits (such as MaxRequestBytes and MaxFieldLength) or the maximum allowed URL length, the server rejects the request.

    The actual request size can be significantly larger than the number of characters entered due to the following factors:

    • Character encoding: Special characters are encoded before being sent. For example, # is converted to %23.
    • Multiple encoding passes: Some values may be encoded more than once as the request is processed. For example, # becomes %23 after the first encoding, %2523 after the second, and %252523 after the third. As a result, a single character can occupy up to seven characters in the request.
    • Additional request data: Cookies and other HTTP headers also contribute to the overall request size and count toward the applicable limits.

    This behavior applies to special characters in general, not just non-English or Unicode characters.

    Issue Resolution

    Important: The following settings apply to all applications on the server that use HTTP.sys, including SOTI MobiControl. Before making any changes, back up the Windows registry and test the changes in a non-production environment.

    Follow these steps to increase the server request size limits:

    1. Open Command Prompt as an administrator.
    2. Run the following command to set MaxRequestBytes to 65534:
      reg add HKLM\SYSTEM\CurrentControlSet\Services\HTTP\Parameters /v MaxRequestBytes /t REG_DWORD /d 65534 /f
      
    3. Run the following command to set MaxFieldLength to 65534:
      reg add HKLM\SYSTEM\CurrentControlSet\Services\HTTP\Parameters /v MaxFieldLength /t REG_DWORD /d 65534 /f
      
    4. Restart the server for the new registry values to take effect.
    5. Submit the same request again to verify that it succeeds.

    After applying these changes, requests can accommodate approximately twice as much input as before. The exact increase depends on the characters used, as special characters require additional space after encoding.

    Status

    The request size limits can be increased by applying the registry changes described above.

    If the request continues to fail after these changes, the maximum URL length may have been reached. Increasing the request size limits does not necessarily resolve URL length restrictions.

    Additional Information

    If requests continue to fail after increasing the server request limits, contact SOTI Support for further assistance.

    Was this helpful?