In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces "how to understand the maximum length limit of URL". In daily operation, I believe many people have doubts about how to understand the maximum length limit of URL. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the question of "how to understand the maximum length limit of URL". Next, please follow the editor to study!
When I was developing and debugging the Alipay interface, I suddenly found that the URL of the Alipay interface was very long, which was much larger than the 255characters I had remembered before. Quickly search and verify, understand as follows:
It is true that URL cannot be greater than 255bytes. It is mentioned in RFC2616:
The copy code is as follows:
The HTTP protocol does not place any a priori limit on the length of a URI. Servers MUST be able to handle the URI of any resource they serve, and SHOULD be able to handle URIs of unbounded length if they provide GET-based forms that could generate such URIs. A server SHOULD return 414 (Request-URI Too Long) status if a URI is longer than the server can handle (see section 10.4.15).
Note: Servers ought to be cautious about depending on URI lengths above 255 bytes, because some older client or proxy implementations might not properly support these lengths.
As can be seen from the previous point, 255bytes's argument is also for compatibility considerations. In fact, the limitations of modern browsers are as follows:
The copy code is as follows:
Microsoft Internet Explorer (Browser)
Microsoft states that the maximum length of a URL in Internet Explorer is 2083 characters, with no more than 2048 characters in the path portion of the URL. In my tests, attempts to use URLs longer than this produced a clear error message in Internet Explorer.
Firefox (Browser)
After 65536 characters, the location bar no longer displays the URL in Windows Firefox 1.5.x. However, longer URLs will work. I stopped testing after 100000 characters.
Safari (Browser)
At least 80000 characters will work. I stopped testing after 80000 characters.
Opera (Browser)
At least 190000 characters will work. I stopped testing after 190000 characters. Opera 9 for Windows continued to display a fully editable, copyable and pasteable URL in the location bar even at 190000 characters.
Apache (Server)
My early attempts to measure the maximum URL length in web browsers bumped into a server URL length limit of approximately 4000 characters, after which Apache produces a "413 Entity Too Large" error. I used the current up to date Apache build found in Red Hat Enterprise Linux 4. The official Apache documentation only mentions an 8192-byte limit on an individual field in a request.
Microsoft Internet Information Server
The default limit is 16384 characters (yes, Microsoft's web server accepts longer URLs than Microsoft's web browser). This is configurable.
Perl HTTP::Daemon (Server)
Up to 8000 bytes will work. Those constructing web application servers with Perl's HTTP::Daemon module will encounter a 16384 byte limit on the combined size of all HTTP request headers. This does not include POST-method form data, file uploads, etc., but it does include the URL. In practice this resulted in a 413 error when a URL was significantly longer than 8000 characters. This limitation can be easily removed. Look for all occurrences of 16 × 1024 in Daemon.pm and replace them with a larger value. Of course, this does increase your exposure to denial of service attacks.
It is also worth noting that when it is mentioned in the article that the href attribute as URL cannot exceed 1024bytes, this point has not been verified in detail.
To sum up, URL is still not suitable for too long, not as a last resort, try not to submit a large number of parameters through GET, you can consider using POST (about 2m, which should be related to the server and settings). In addition, such a long URL is also quite unfriendly when visiting and collecting (it has been mentioned in some articles that some browsers have problems with storing extra-long addresses). Of course, database fields were previously treated as 255bytes, but now you may want to consider expanding them.
At this point, the study on "how to understand the maximum length limit of URL" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.