Analysis on two length restrictions of form post and get

Source: Internet
Author: User
Tags form post
I. Cause After a project is released, the bug statistics Appendix "post-release issues" contains:

problem cause analysis remarks
if the number of topics to be processed is too large during CSV processing, the URL parameter upper limit error occurs. passing a variable-length parameter through a URL may cause this potential error. 1. Due to a problem that occurred twice, the development team was not notified of Relevant Precautions through checklist or other methods in a timely manner;
2. No big batch data test was performed during the test.
1. Add it as experience to the checklist to enhance the effect of group sharing and inspection;
2. Check whether the test points are complete and focus on testing common issues in development.
when the original GUI status of the module is confirmed and the CSV output results are very large, the contents of the CSV file cannot be output. the size of post data cannot exceed kb. This is a new problem. It has never been met before, nor has it been tested on a large scale. this type of check has been listed in the checklist
As an accumulation of experience, these problems, causes and solutions will be included in the checklist. So: is the first question: is the upper limit of URL parameters accurate? What is the upper limit? The second question: why is there a limit on post data? Is the limit kb? Ii. Problem Analysis 1. First: 1) The URL does not have a maximum of parameters. This problem is actually caused by the restriction on the URL Length of IE. 2) the HTTP protocol specification does not limit the URL length. This restriction is imposed by specific browsers and servers. The length of the URL is limited to 2083 bytes (2 k + 35) by IE ). For other browsers, such as Netscape and Firefox, there is no length limit theoretically. The limit depends on the support of the operating system. [Parameter 1] 3) "variable-length parameters are passed through URL" means that the get method is used when submitting a form, rather than the POST method. This potential error is caused by the use of the get method to submit form data. Because the get method places the data in the URL and passes it to the server for processing. 4) Note that this limit is the length of the entire URL, not just the length of your parameter value data. 5) since it is the restriction on the URL Length of IE, this restriction exists in both get and post methods. (For details about form get and post methods, refer to relevant materials [parameter 2]). Suggestion: 1) understand the application Program Environment, such as the Web application browser and server environment, to understand its specific parameter restrictions. 2) try to use the post method when submitting complex data. Note that the get method is used by default when the form does not write the method attribute. Conclusion (write to checklist ): When submitting data using the get method, you must consider the URL length limit of 2083 bytes in the IE environment. 2. Second: 1) theoretically, there is no size limit on post. The HTTP protocol specification does not limit the size. 2) "there is a K size limit on the size of Post Data" is not accurate enough. There is no limit on post data, and the limit is the processing capability of the server's processing program. 3) for ASP programs, the request object has a k Data Length limit when processing each form field. However, if request. binaryread is used, there is no such restriction. For solutions to process data in more than K form fields, see [parameter 3]. 4) This extension adds the limit [parameter 4] for IIS 6.0 and Microsoft for security reasons. We also need to note: by default, IIS 6.0 has a maximum ASP post data volume of KB, and each form field is limited to kb. By default, IIS 6.0 uploads a file up to 4 MB. By default, IIS 6.0 has a maximum request header of 16 kb. These restrictions are not available before IIS 6.0. Suggestion: 1) figuring out the default settings of the runtime environment helps you design and quickly solve problems. 2) consider the server version. Different versions of IIS have different default settings for these parameters. If necessary, sort out a reference table. This provides a reference for development and testing. 3) These restrictions of IIS 6.0 are only the default values. You can modify them in the actual application environment. In winnt \ system32 \ inetsrv \ metabase. XML, the following parameters are defined by default:
Aspbufferinglimit = "4194304" corresponds to the maximum size of the uploaded file
Aspmaxrequestentityallowed = "204800" corresponds to the maximum data size of post... Conclusion (write to checklist ): When using ASP, you need to consider the KB limit for reading and processing each field of the post form. Whether to use request. binary. References: 1. Maximum URL length is 2,083 characters in Internet Explorer 2. Hypertext Transfer Protocol -- HTTP/1.13, PRB: error "request object, ASP 0107 (0x80004005) "When you post a Form 4, IIS 6.0 troubleshooting [client requests error-out or time-out]

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.