The difference between get and post methods

In the process of submitting data from the form, the method attribute provides two values: get and post. The default is get [ref. 1]

That is, one is get submission and the other is post submission. So what are the differences between the two submission methods?

After querying some data, it is summarized as follows:

1. Essence

Get is a request to request data from the server, while post is a request to submit data to the server

2. Method of obtaining value from server

For the data submitted by get, the server uses request Querystring gets the value of the variable

For data submitted in post mode, the server uses request Get data from form

3. Safety

The security of get mode is low, and that of post mode is relatively safe. However, the execution efficiency of post mode is worse than that of get mode.

4. Mechanism

Get is to add the parameter data queue to the URL indicated by the action attribute of the submission form, such as: http://www.xxx.com?sessonid=db23434&name=hongten&age=20 。 In the URL, the values correspond to each field of the form one by one, and these are visible to the user in the URL, that is, they can be seen by the user. For example: name = hongten.

Post is to place the fields in the form and their contents in the HTML header through the HTTP post mechanism and transfer them to the URL address indicated by the action attribute. This is transparent to users.

5. Size

The URL does not have the problem of upper parameter limit, and the HTTP protocol specification does not limit the URL length. This restriction is imposed by specific browsers and servers. Ie limits the URL length to 2083 bytes (2k + 35). For other browsers, such as Netscape and Firefox, there is no length limit in theory, which depends on the support of the operating system.

Theoretically, there is no size limit for post, nor is there any size limit in the HTTP protocol specification. It is inaccurate to say that "there is a size limit of 80K / 100k for the amount of post data". There is no limit for post data, which is limited by the processing capacity of the server's handler.

For ASP programs, there is a data length limit of 100k when the request object processes each form field. But if you use request BinaryRead does not have this restriction.

From this extension, Microsoft has increased restrictions on IIS 6.0 for security reasons. We also need to pay attention to:

1). By default, the maximum amount of ASP post data in IIS 6.0 is 200KB, and the limit of each form field is 100kb. 2). By default, the maximum size of uploaded files in IIS 6.0 is 4MB. 3). IIS 6.0 default maximum request header is 16kb. There were no such restrictions before IIS 6.0. [ref. 2]

Summary:

One: the security of the get method is worse than that of the post method. Therefore, if it contains some important information, it is easy to use the post data submission method

Two: it's better to use get when making query statistics; When adding, modifying or deleting data, it is recommended to use the post data submission method

reference resources:

one

two

More information:

========================================================

More reading,and english is important.

I'm Hongten

大哥哥大姐姐,觉得有用打赏点哦!多多少少没关系,一分也是对我的支持和鼓励。谢谢。Hongten博客排名在100名以内。粉丝过千。Hongten出品,必是精品。

E | hongtenzone@foxmail.com B |

========================================================

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>