What is the maximum length of a URL in different browsers? Does it differ among browsers?
Does the HTTP protocol dictate it?
What is the maximum length of a URL in different browsers? Does it differ among browsers?
Does the HTTP protocol dictate it?
Why is the Internet Explorer limit only 2K while IIS has a limit of 16K? I don't think it makes sense.
So I want to start an experiment about Ajax request URL size limits.
I have set my Tomcat HTTP connector's maxHttpHeaderSize="1048576". And prepared a very long URL.
Then I send a request with the long URL like the following:
jQuery reports done. Tomcat reports the URL requested is 1048015 bytes. It was tested with Chrome 50 and Internet Explorer 11.
So web browsers won't truncate or limit your URL intentionally when sending Ajax requests.
It seems that Chrome at least has raised this limit. I pasted 20,000 characters into the bookmarklet and it took it.
Microsoft Support says "Maximum URL length is 2,083 characters in Internet Explorer".
IE has problems with URLs longer than that. Firefox seems to work fine with >4k chars.
I wrote this test that keeps on adding
'a'
to parameter until the browser failsC# part:
View:
PART 1
On Chrome I got:
It then blew up with:
Same on Internet Explorer 8 and Firefox
PART 2
I went easy mode and added additional limits to IISExpress
applicationhost.config
andweb.config
settingmaxQueryStringLength="32768"
.after 7744 characters.
PART 3
Added
which didn't help at all. I finally decided to use fiddler to remove the referrer from header.
Which did nicely.
Chrome: got to 15613 characters. (I guess it's a 16K limit for IIS)
And it failed again with:
Firefox:
Internet Explorer 8 failed with iexplore.exe crashing.
After 2505
Android Emulator
Internet Explorer 11
Internet Explorer 10
Internet Explorer 9
The HTTP 1.1 specification says:
As mentioned by @Brian, the HTTP clients (e.g. browsers) may have their own limits, and HTTP servers will have different limits.
On Apple platforms (iOS/macOS/tvOS/watchOS), the limit may be a 2 GB long URL scheme, as seen by this comment in the source code of Swift:
On iOS, I've tested and confirmed that even a 300+ MB long URL is accepted. You can try such a long URL like this in Objective-C:
And catch if it succeed with: