414 (Request-URI Too Long)

13,014

Two options to resolve the problem for 414 response code:

1. By POST request: Convert query string to json object and sent to API request with POST

2. By GET request: Max length of request is depend on sever side as well as client side. Most webserver have limit 8k which is configurable. On the client side the different browser has different limit. The browser IE and Safari limit to 2k, Opera 4k and Firefox 8k. means the max length for the GET request is 8k and min request length is 2k.

If exceed the request max length then the request truncated outside the limit by web server or browser without any warning. Some server truncated request data but the some server reject it because of data lose and they will return with response code 414.

Share:
13,014
PartTimeNerd
Author by

PartTimeNerd

.NET Developer Interested in Android Application Development

Updated on December 08, 2022

Comments

  • PartTimeNerd
    PartTimeNerd over 1 year

    I am working on MVC platform and I am calling jqGrid using JSON GET.

    I have read on Request Limits, maxQueryStringLength, maxAllowedContentLength, maximum length of URL and configure the web.config as of following

    <httpRuntime maxRequestLength="2147483647" executionTimeout="1200" requestValidationMode="2.0" maxQueryStringLength="2097151" maxUrlLength ="65536"/>
    

    &

    <requestLimits maxUrl ="65536" maxAllowedContentLength="4294967295" maxQueryString ="2097151" />
    

    But it is still giving me the 414 (Request-URI Too Long) error.

    Any idea what could be the solution to this?

    EDIT:

    Based on Rory's comment, I changed from GET request to POST. By changing it should solve the issue. Discussion can be found here here. However, I am still facing the same issue after changing it and going through ASP.Net Core maxUrlLength