A brief analysis of the difference between post and get methods

Time:2020-1-7

For example, name = John. In the queue, values and forms are separated by a & sign, spaces are replaced by a + sign, and special symbols are converted into hexadecimal code. Because this queue is in the URL, the parameters of the queue can be seen, recorded, or changed. Usually get methods also limit the size of characters (about 256 bytes). In fact, post method can transfer data to the server without time limit, and users can’t see this process in the browser side, so post method is more suitable for sending a confidential (such as credit card number) or a large number of data to the server.

Difference:
Post is a method that allows a large amount of data to be transmitted, while get will attach the data to be transmitted to the web address and then deliver it to the server together, so the amount of data to be transmitted will be limited, but the execution efficiency is better than post.

Recommendation:
1. Get is less secure than post. If it contains confidential information, post data submission is recommended;
2. In data query, it is recommended to use get mode, while in data addition, modification or deletion, it is recommended to use post mode;

When the attribute value of method is post, all the values of HTML control cells in the < form > segment submitted as the request are set, and each member is read-only. (used to retrieve the value of a form element in the body of an HTTP request.)
Sub.htm: note that the method is post
<form action=”demo.asp” method=post>
<input type=text name=”Content” size=20>
< input type = submit value = “submit” >
</form>
demo.asp:
<%Dim TextCon
TextCon=request.form(“Content”)
response.write TextCon %>
When querystring form information is sent by get method, the server or another ASP page will receive it by querystring method. (used to retrieve the value of a variable in the HTTP query string.)
Sub.htm: note that the method is get
<form action=”demo.asp” method=get>
<input type=text name=”Content” size=20>
< input type = submit value = “submit” >
</form>
demo.asp:
<%Dim TextCon
TextCon=request.querystring(“Content”)
response.write TextCon %>
In this case, instead of sub.htm, type demo. ASP? Content = in the address bar to demonstrate querystring. Request.form cannot.