Sam Lee
Sam Lee

Reputation: 7199

Max length of query string in an AJAX GET request?

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?

Upvotes: 10

Views: 16702

Answers (3)

cletus
cletus

Reputation: 625347

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.

Upvotes: 12

asleep
asleep

Reputation: 4084

Max length for a GET is 2,048 characters =]

Upvotes: 0

Noon Silk
Noon Silk

Reputation: 55172

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.

Upvotes: 2

Related Questions