Working with a project, some page happen to use query string a lots, passing data in the URL, there are a lots of data passing through the URL. Finally I ran into a problem:
The server complaint that the URL is too long, guess it can’t digest. According to Microsoft, the maximum length for URL is 2,083, ran a test to verify, the exceeded character is truncated. But in my case, we are passing data in the URL, and we need the server to accept it, of course, there is always a better solution! If it happen that we do not have permission or some reason to edit the source, we could tell the IIS to accept more, by adding this,
<configuration> <system.webServer> <security> <requestFiltering> <requestLimits maxAllowedContentLength="30000000" maxUrl="260" maxQueryString="1000" /> </requestFiltering> </security> </system.webServer> </configuration>
maxQueryString can be set to allow more, yet, I’m still not verify what is the maximum for this and what is the possible impact on the server apart from heavy data problem, I guess the default maximum there for a reason, so is best to not abusing the setting.