Because JSONP cross-domain requests are only available through GET requests, the URL length varies depending on the browser and server. To support IE, the maximum length is 2083 characters, if the Chinese character is only 2083/9=231 characters. If Chrom ...
Keywords: server, browser, URL length limit
Today, when writing a PHP corresponding JSONP request function, it is found that the URL contains a request parameter that is too long to return a 414 error.
Such as
414 Request-URI Too Large</title>
<body bgcolor="white">
<center>414 Request-URI Too Large
nginx</center>
</body>
After the online query, the browser and server on the length of the URL is limited, now summarized as follows.
Browser 1. IE
IE browser (Microsoft Internet Explorer) has a URL length limit of 2083 (2k+53), which exceeds this limit and is automatically truncated (if the Submit button does not work if the form is submitted).
2. Firefox
The URL length of Firefox is limited to 65 536 characters, but in fact the maximum valid URL length is not less than 100,000 characters.
3. Chrome
Chrome (Google) has a URL length limit of more than 8,182 characters to return the errors listed at the beginning of this article.
4. Safari
Safari has a URL length limit of at least 80 000 characters.
5. Opera
The URL length of the Opera browser is limited to 190 000 characters. You can still edit the 190 000 characters in the Opera 9 address bar.
Server 1. Apache
Apache can accept a URL length limit of 8 192 characters
2. IIS
Microsoft Internet Information Server (IIS) can accept a URL length limit of 16 384 characters.
This is possible by modifying the (IIS7) configuration/system.webserver/security/requestfiltering/requestlimits@maxquerystringsetting.<requestLimits maxQueryString="length"/>
3. Perl HTTP::D Aemon
Perl HTTP::D Aemon can at least accept a URL length limit of 8000 characters. Perl http: The total length of the limit HTTP request headers in the:D Aemon is not more than 16 384 bytes (excluding post,file uploads, etc.). However, a 413 error is returned when the URL exceeds 8000 characters.
This restriction can be modified to find the 16x1024 in daemon.pm and change it to a larger value.
4, Ngnix
You can change the URL length limit for a URL request string by modifying the configuration.
client_header_buffer_size
Default value:client_header_buffer_size 1k
large_client_header_buffers
Default value:large_client_header_buffers 4 4k/8k
Because JSONP cross-domain requests are only available through GET requests, the URL length varies depending on the browser and server.
To support IE, the URL length is limited to 2083 characters, and if the Chinese character is only 2083/9=231 characters.
If the largest Chinese characters supported by the Chrome browser are only 8182/9=909.
Summary of maximum length limit for URLs in get requests