This article is a mirror article of machine translation, please click here to jump to the original article.

View: 8192|Reply: 0

GET POST method length limit

[Copy link]
Posted on 12/17/2015 10:38:05 AM | | |
1. Get method length limit

There is no limit on the size and length of the data submitted by the Http Get method, and the HTTP protocol specification does not limit the length of the URL. This limit is a limitation imposed by a specific browser and server.

For example, IE's URL length limit is 2083 bytes (2K+35).

Here are some explanations of the maximum processing power of various browsers and servers.

Microsoft Internet Explorer (Browser)

IE has a maximum limit of 2083 characters for URLs, and if you exceed this number, the submit button will not respond.
Firefox (Browser)

For Firefox, the URL is limited to 65,536 characters.

Safari (Browser)

The maximum length of a URL is limited to 80,000 characters.

Opera (Browser)

The maximum length of a URL is limited to 190,000 characters.

Google (chrome)

The maximum length of the URL is limited to 8182 characters.

Apache (Server)

The maximum URL length that can be accepted is 8,192 characters.

Microsoft Internet Information Server(IIS)

The maximum URL length that can be accepted is 16,384 characters.

From the above data, it can be seen that in order for all users to browse normally, it is best not to exceed the maximum length limit of IE (2083 characters), of course, if the URL is not provided directly to the user, but to the program call, the length is only affected by the web server.

Note: For Chinese transmission, the final encoding form will be transmitted for urlencode, if the browser encoding is UTF8, the final encoded character length of a Chinese character is 9 characters.

Therefore, if you use the GET method, the maximum length is equal to the maximum length of the URL minus the number of characters in the actual path.

2. POST method length limit

Theoretically, there is no size limit for POST. The HTTP protocol specification also does not have a size limit, but the processing power of the server's handler is the limiting effect.

For example, remove the POST size limit under Tomcat (Tomcat defaults to 2M);

Open the conf directory in the tomcat directory, open the server.xml file, and modify it

<Connector

debug="0"

acceptCount="100"

connectionTimeout="20000"

disableUploadTimeout="true"

port="8080"

redirectPort="8443"

enableLookups="false"

minSpareThreads="25"

maxSpareThreads="75"

maxThreads="150"

maxPostSize="0"

URIEncoding="GBK"

>

</Connector>

Add red font part maxPostSize="0" (setting 0 is to remove the size limit of POST)






Previous:.net converts the specified file to MemoryStream
Next:C# Image and Base64 encoded interconversion functions
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com