Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the difference between post and get data transmission in Form form

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "what is the difference between post and get data transmission in Form forms?" in the operation of actual cases, many people will encounter such a dilemma, and then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The get and post methods in Form correspond to the GET and POST methods in HTTP protocol respectively in the process of data transmission. The main differences between the two are as follows:

1. Get is used to obtain data from the server, while Post is used to transfer data to the server.

2. Get adds the data in the form in the form of variable=value after the URL pointed to by action, and the two use "?" Connect, and the variables are connected by "&"; Post is to put the data in the form in the data body of form and pass it to the URL pointed to by action in the way that variables and values correspond.

3. Get is not secure, because in the process of transmission, the data is placed in the requested URL, and now many existing servers, proxy servers or user agents will record the request URL in the log file and put it somewhere, so that some private information may be seen by third parties. In addition, the user can also see the submitted data directly in the browser, and some internal messages will be displayed in front of the user. All operations of Post are invisible to the user.

4. The amount of data transferred by Get is small, which is mainly due to the limitation of URL length; while Post can transfer a large amount of data, so you can only use Post when uploading files (of course, another reason will be mentioned later).

5. Get restricts the value of the dataset of the Form form to be ASCII characters; Post supports the entire ISO10646 character set.

6. Get is the default method for Form.

The data transmitted by Post can be correctly converted into Chinese by setting the encoding, while the data transmitted by Get remains unchanged. We must pay attention to this point in the future procedure.

1. The Get method transmits the user's data through the URL request, connects the field names in the form with their contents in pairs of strings, and places them after the url of the program referred to in the action attribute, such as http://www.mdm.com/test.asp?name=asd&password=sad, the data will be displayed directly on the url, just as the user clicks a link. Through the HTTP post mechanism, the Post method transmits the names of the fields in the form together with their contents in the HTML header (header) to the server for processing by the program referred to by the action performance. The program will read out and process the data of the form through the standard input (stdin).

2. In Get mode, you need to use Request.QueryString to get the value of the variable, while in Post mode, you can access the submitted content through Request.Form.

3. The amount of data transmitted by Get is very small, which is generally limited to about 2 KB, but the execution efficiency is better than that of Post. While the amount of data transmitted by Post is relatively large, it waits for the server to read the data, but there is also a byte limit, in order to avoid malicious attacks on the server with a large amount of data. According to Microsoft, Microsoft has a limit on the maximum amount of data that can be received with Request.Form (), 80 KB bytes in IIS 4 and 100 KB bytes in IIS 5.

Suggestion: unless you are sure that the data you submitted can be submitted at once, please use the Post method as much as possible

4. Submitting data by Get will bring security problems, such as a landing page. When you submit data through Get, the user name and password will appear on the URL. If the page can be cached or other people can access the customer's machine, you can obtain the user's account number and password from the history, so it is recommended to use the Post method for form submission. A common problem with a form page submitted by the Post method is that when the page is refreshed, a dialog box pops up

Recommendation: for security reasons, it is recommended that you use Post to submit data

This is the end of the content of "what is the difference between post and get data transmission in Form forms". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report