欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

http协议中,url最大长度是多少?

下面就是对各种浏览器和服务器的最大处理能力做一些说明.
Microsoft Internet Explorer (Browser)
IE浏览器URL的最大限制为2083个字符,如果超过这个数字,提交按钮没有任何反应。在我的测试中,这个数字得到验证。
Firefox (Browser)
写道Bad Request
Your browser sent a request that this server could not understand.
Size of a request header field exceeds server limit.
??Safari (Browser)
URL最大长度限制为 80,000个字符。
Opera (Browser)
URL最大长度限制为190,000个字符。
Google (chrome)
url长度一旦超过8182个字符时,出现如下服务器错误:写道Request-URI Too Large
The requested URL's length exceeds the capacity limit for this server.
Apache/2.2.12 (Ubuntu) Server at 127.0.1.1 Port 80??Apache (Server)
能接受最大url长度为8,192个字符,但我的测试数据是8,182,10个字符,差别不在,数据具体符合。
Microsoft Internet Information Server(IIS)
能接受最大url的长度为16,384个字符。
通过上面的数据可知,为了让所有的用户都能正常浏览,我们的URL最好不要超过IE的最大长度限制(2038个字符),当然,如果URL不直接提供给用户,而是提供给程序调用,侧这时的长度就只受Web服务器影响了。
注:可能有些朋友会想当然的认为,如果最大长度限制为2038字符,是不是参数差不多可以传递1000个左右的汉字。

来自  https://zhidao.baidu.com/question/1540133658614222827.html
普通分类: