post and get submission

What is the difference between post and get submission methods?

(1) Post is to send data to the server; get is to obtain data from the server.

(2) On the client side, get adds the parameter data queue to the URL pointed to by the ACTION attribute of the submitted form. The value corresponds to each field in the form, which can be seen in the URL.

Post uses the HTTP post mechanism to place each field in the form and its content in the HTML HEADER and send it to the URL address pointed by the ACTION attribute. The user cannot see this process.

(3) For the get method, the server uses Request.QueryString to obtain the value of the variable, and for the post method, the server uses Request.Form to obtain the submitted data.

For example: get submit Request.QueryString["aa"].ToString();

Post submission with Request.Form["aa"].ToString();

(4) The amount of data that get can transmit is very small, only 1024 bytes, not more than 2KB. The amount of data transmitted by post is relatively large, and it is generally unrestricted by default. But in theory, the maximum amount is 80KB in IIS4 and 100KB in IIS5.

(5) Security issues. As mentioned in (1), when using get, the parameters will be displayed on the browser address bar, but post will not.

Suggest:

1. The security of the get method is worse than that of the post method, but the execution efficiency is better than that of the post method.

If these data are Chinese data and non-sensitive data, then use get; if the data entered by the user is not Chinese characters and contains sensitive data, including confidential information, it is recommended to use post data submission method;

2. When doing data query, it is recommended to use the get method; when doing data addition, modification or deletion, it is recommended to use the post method;

Summary: (short answer)

(1) Get parameters will be displayed in the browser address bar, while post parameters will not be displayed in the browser address bar;

(2) When you click the [Refresh] button on the page submitted by post, the browser will generally prompt "resubmit", but get does not;

(3) Pages with get can be crawled by search engines, but not with post;

(4) The amount of data that can be submitted with post is very large, while the amount of data that can be submitted with get is very small (2k), which is limited by the length of the web page address.

(5) You can submit files with post, but not with get.

Guess you like

Origin blog.csdn.net/qq_37192571/article/details/108882327