There are 5 points in the difference between the get and the post mode in the form of the form.
1.Get is to obtain data from the server, and post is to send data to the server.
2.Get is to add the parameter data queue to the URL referred to the ACTION attribute submitted by the form. The value corresponds to each field in the form, which can be seen in the URL. POST is the HTTPPOST mechanism to place each field and content in the form and content in HTML Header in the URL address referred to in the Action property. Users can't see this process.
3. For the get method, the server uses request.querystring to obtain the value of the variable. For the post mode, the server uses request.form to obtain the submitted data.
4. The amount of data transmitted byget is small and cannot be greater than 2KB. The amount of data transmitted by POST is generally not limited by default. But theoretically, the maximum amount of IIS4 is 80kb and 100KB in IIS5.
5.Get is very low security, and POST is high.
Http request: the difference between get and post methods
HTTP defines different methods of interaction with the server. The most basic way is get and post. In fact, GET is suitable for most requests, and retaining POST is only used for updating sites. According to the HTTP specification, GET is used for information acquisition, and it should be safe and power. The so -called security means that the operation is used to obtain information rather than modify information. In other words, GET requests generally should not produce side effects. The power of power means that multiple requests for the same URL should return the same result. The complete definition is not as strict as it looks. Fundamentally, her goal is that when the user opens a link, she can be sure that she has not changed resources from her own perspective. For example, the front page of the news site is constantly updated. Although the second request will return different batch of news, the operation is still considered to be safe and power, because it always returns the current news. vice versa. The post request is not so easy. Post indicates the request to change the resources on the server. Still taking the news site as an example, the reader's annotation of the article should be implemented through the POST request, because the site is different after the comment is submitted (for example, a note appears below the article);
When the form is submitted, if you do not specify the MetHod, the default is the GET request. The data submitted in the form will be attached to the URL and separate from the URL. The numeric character is sent, but the space is converted to+number, and the other symbols are converted to%xx. The XX is an ASCII (or isolatin-1) value represented by hexadecimal. GET requests are requested to be placed in the HTTP request protocol header, while the data submitted by the post is placed in physical data;
The data submitted by the GET method can only have 1024 bytes at most, while the post does not have this limit.
What is the difference between using post and get in the form
In Form, you can use POST or GET. They are all legal values of Method. However, there are at least two different points in use and get:
1. Get method pass the URL request to pass the user's input. The post method passes another form.
2. Submitting of the GET method you need to use request.querystring to obtain the value of the variable, and when the post method is submitted, you must access the submitted content through request.form.
Study the following code carefully. You can feel it if you can run:
Code
<! - Two Form only has different METHOD attributes->
<Form action = getpost.asp method = get?
"Input Type = Text name = Text Value = Hello World> </Input>
"Input Type = Submit Value = Method = Get> </Input>
</Form>
<br>
"Form Action = Getpost.asp Method = Post>
"Input Type = Text name = Text Value = Hello World> </Input>
"Input Type = Submit Value = Method = Post>"/Input>
</Form>
<br>
<br>
< % If request.querystring (text) <> then %>
The string transmitted through the get method is: <b> < %= request.querystring (text) %> </b> <br>
< % End IF %>
< % If request.form (text) <> then %>
The string passed through the post method is: <b> < %= request.form (text) %> </b> <br>
< % End IF %>
illustrate
Save the above code to getpost.asp, then run, first test the post method. At this time, the URL of the browser has not changed. The result is:
The string passed through the post method is: Hello World
Then test it to submit it with the GET method. Please note that the URL of the browser becomes:
http: //localhost/general/Form/getpost.asp? Text = Hello+World
The result of returning is:
The string passed through the get method is: Hello World
Finally submit it through the post method, the URL of the browser is still:
http: //localhost/general/Form/getpost.asp? Text = Hello+World
The result of the return becomes:
The string passed through the get method is: Hello World
The string passed through the post method is: Hello World
hint
Submitting data through the GET method may bring security issues. Such as a login page. When the data is submitted through the GET method, the username and password will appear on the URL. if:
1. The login page can be cached by the browser;
2. Others can access the customer's machine.
Then, others can read this customer's account and password from the historical records of the browser. Therefore, in some cases, the get method brings serious security issues.
suggestion
http://www.devdao.com/
In Form, it is recommended to use the POST method.
The difference between get and post 2
GET: It is the information that the resource specified by the request URI in a physical way. If the request URI is just a data generated process, then the resource that the process of processing the processing process will be returned in the response entity, not the processing process of the processing process, not the processing process describe.
POST: Use a request to the server, ask it to accept the entity attached to the request, and use it as an additional new sub -item that requests the resource specified by the URI in the request queue. Function:
1: Explanation of existing resources
2: Sales information to the electronic publicity column, news group, email list or similar discussion group.
3: Submit the data block
4: Extend the database by additional operations
It can be seen from the above description that GET is a request to send data to the server; POST is a request to submit data to the server. The data to be submitted is located in the entity behind the information head.
It is theoretical, but it is very standard. Method = Get is not obtaining data from the server. Get and Post just send different sending mechanisms, not one sending one!
The get method will display the value you brought in the IE address column; the post method will not
1. GET is the URL referred to the parameter data queue to the ACTION attribute submitted by the form. The value corresponds to each field in the form, which can be seen in the URL. POST is the HTTPPOST mechanism to place each field and content in the form and content in HTML Header in the URL address referred to in the Action property. Users can't see this process.
2. For the GET method, the server uses request.querystring to obtain the value of the variable. For the post mode, the server uses request.form to obtain the submitted data. Both of the parameters can be obtained with Request.
3. The amount of data transmitted in get is small and cannot be greater than 2KB. The amount of data transmitted by POST is generally not limited by default. But theoretically, the maximum amount of IIS4 is 80kb and 100KB in IIS5.
4. GET is very low security, and POST is more secure.
5. "Form Method = get action = a.ASP? B = B> is the same as" Form Method = GetAction = A.ASP ", that is, the parameter list with the behind Action page will be ignored; and" FormMethodHod = Post action = a.ASP? B = B> is different from <FORM METHOD = PostAction = A.ASP>.
In addition, the GET request has the following characteristics: it adds the data to the URL, and passes to the server in this way. Usually a question mark is used? Represents the end of the URL address and the beginning of the data parameter. Each data parameter in the subsequent parameters appears in the form of the name = value. The parameter and the parameter are distinguished by a connection symbol.
The POST request has the following features: the data is placed in the HTTP main body. There are more than one organizational method. There are & connection methods, as well as dividing symbols, which can hide parameters and pass a large number of data, which is more convenient.
There will be no large string of POST address column? Bjnghfgreygt like this
If it is get, it will appear
1. GET methods pass the user's data through the URL request. The field names in the form in the form are connected to the paired string. After the URL of the program referred to by the Action property, such as http://www.mdm. com/test.asp? name = ASD & Password = SAD, the data will be displayed directly on the URL, just like a user clicks a link; the post method passes the HTTP post mechanism to place the field names and content of each field in the form (Header (Header (Header (Header (Header. ) The program is transferred to the server to handle the procedure referred to by the attribute of Action.
2. GET method needs to use request.querystring to obtain the value of the variable; and the post method to access the submitted content through request.form
3. The amount of data transmitted by the GET method is very small, which is generally limited to about 2 KB, but the execution efficiency is better than the POST method; the amount of data transmitted by the post method is relatively large. It is waiting for the server to read the data, but there are words. The festival restrictions are to avoid malicious attacks on the server with a lot of data. According to Microsoft, Microsoft has the maximum data that can be received with Request.form (). For 100 kb bytes
Suggestion: Unless you definitely submit the data you submit can be submitted at one time, please try to use the POST method as much as possible
4. Submitting data in the GET method will bring security issues. For example, when a login page, when the data is submitted through the GET mode, the username and password will appear on the URL. If the page can be cached or someone can access the customer of the customer, it will You can obtain the user's account and password from the historical record, so the form is recommended to use the POST method; the common problem submitted by the post method is that if the page is refreshed, a dialog box will pop up a dialog box.
1. GET is the URL referred to the parameter data queue to the ACTION attribute submitted by the form. The value corresponds to each field in the form, which can be seen in the URL. POST is the HTTPPOST mechanism to place each field and content in the form and content in HTML Header in the URL address referred to in the Action property. Users can't see this process.
2. For the GET method, the server uses request.querystring to obtain the value of the variable. For the post mode, the server uses request.form to obtain the submitted data. Both of the parameters can be obtained with Request.
3. The amount of data transmitted in get is small and cannot be greater than 2KB. The amount of data transmitted by POST is generally not limited by default. But theoretically, the maximum amount of IIS4 is 80kb and 100KB in IIS5.
4. GET is very low security, and POST is more secure.
5. "Form Method = get action = a.ASP? B = B> is the same as" Form Method = GetAction = A.ASP ", that is, the parameter list with the behind Action page will be ignored; and" FormMethodHod = Post action = a.ASP? B = B> is different from <FORM METHOD = PostAction = A.ASP>.