Summary of maximum length limit for URLs in get requests

Source: Internet
Author: User

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

  1. 414 Request-URI Too Large</title>
  2. <body bgcolor="white">
  3. <center>414 Request-URI Too Large
  4. nginx</center>
  5. </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_sizeDefault value:client_header_buffer_size 1k

large_client_header_buffersDefault 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.