From time to time I find myself in a situation where I need to send rather large ajax GET requests from my java script client to my asp.net-mvc application (running IIS 7). If the URL is longer than 2048 characters, you get a default exception. A simple solution to this was to increase maxQueryStringLength using web.config.
My question is, are there any good reasons why you shouldn't follow this path, and if it is actually considered a hack? I read something about different browsers limiting the number of characters in the address field, but if you use only ajax, could this be a problem worth thinking about?
I know that in many cases you should use POST instead of passing large amounts of data to the request, but sometimes this is not an option. For example, when your URL returns a file to be downloaded by the user.
One specific example of where I had to increase maxQueryStringLength is: A user requests some locations on a map bounded by a polygon. If you want to send this polygon to a URL, you can easily exceed the maximum length of the URL.
source share