Is there/what is the maximum length of the query string when doing an AJAX GET request? More specifically, I am doing cross-domain AJAX using an image:
img = new Image();
img.src = "http://www.otherdomain.com/something.gif?long_query_string=long........";
What is the limit on the query string here?
If you are using the GET method, you are limited to a maximum of 2,048 characters, minus the number of characters in the actual path.
Although officially there is no limit specified by RFC 2616, many security protocols and recommendations state that maxQueryStrings on a server should be set to a maximum character limit of 1024. While the entire URL, including the querystring, should be set to a max of 2048 characters.
In Firefox the length of the URL can be unlimited but practically after 65,536 characters the location bar no longer displays the URL. Edge allows the URL length to be a maximum of 2083 characters but not more than 2048 characters in the path portion of the URL. Opera allows the URL length to be unlimited.
Property Value The length of the URL, in number of characters. The default is 260.
There is no defined limit in any specification. The effective or prescribed limit is 2048 characters. Certain browsers and Webserver will have problems with longer.
Yes, Query Strings have a maximum length, IIRC it's 2048 chars, or something similar. Though specific implementations probably differ.
Wikipedia has a little bit of info.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With