tags:

views:

1458

answers:

5

What is the character limit for a URL, especially if the URL is formed from a GET method of a form.

+11  A: 

There's no published maximum, but the effective limit is around 2,000 characters because that's what Internet Explorer (version 4 and above) supports. See http://www.boutell.com/newfaq/misc/urllength.html

RichieHindle
And you should be seriously questioning your design if you run anywhere near this limit.
molf
I exceeded it once! ^^
Arnis L.
+4  A: 

Newer IE: 2048 characters Some platforms support only 255.

Byron Whitlock
Knowing which platforms you mean would be helpful, as I was under the impression that IE (@ 2048 chars) supports the lowest URL length of all the popular browsers / platforms...:)
MatW
+4  A: 

According to Microsfot it's 2048. Since they invented the web (and also the light, the darkness and Linux) they are right. :-) .... or.. and since IE forces this lower value, it's the lowest common denominator.

http://support.microsoft.com/kb/208427

Under Firefox, I see people on the net reporting URLs of 0xFFFF working: http://forums.mozillazine.org/viewtopic.php?f=38&t=155648&start=0&st=0&sk=t&sd=a

Here is another post which talks about this: http://hiox.org/index.php?id=425

elcuco
A: 

Hi, I faced a similar problem wherein i am sending a lot of data in URL exceeding the limit of 2048. How can i make sure that i send the entire data in URL without getting that truncated? Cheers...

Abdul
You need to switch to a POST method on the form and sending an extra parameter method=get to distinguish between a post and get.<form method=""post action=""><input type="hidden" name="method" value="get"/></form>The side effect is the user cannot go back using the browser history. We have used this solution only as an ajax call, and made sure the browser history has the right url.
Spring Monkey
+1  A: 

Different browsers have different limits. But generally the limit is around 2,000 characters for the GET method of a URL. You can use a proxy page that does a POST method (if your API supports it) and that has a larger limit of 5,000 characters. We are currently investigating using a proxy page with the Google Map API as we have crashed into the 2,000 character limit.

Droo