Home  >  Article  >  What are the differences between get requests and post requests?

What are the differences between get requests and post requests?

青灯夜游
青灯夜游Original
2019-06-12 16:23:2014990browse

POST request and GET request are commonly used requests in the HTTP protocol, so what is the difference between them? The following article will introduce to you the difference between POST request and GET request. I hope it will be helpful to you.

What are the differences between get requests and post requests?

The difference between GET request and POST request:

1. Get is to get data from the server, and post is Send data to the server.

2. When making a get request, the data is directly requested through the URL. The data information can be seen directly in the URL, such as browser access; while the post request is placed in the request header and the user cannot see it directly.

3. The amount of data transmitted by get is small and limited, and cannot be larger than 2KB; this is mainly because it is limited by the length of the URL. The amount of data transmitted by post is large and is generally unrestricted by default. However, theoretically, the maximum amount is 80KB in IIS4 and 100KB in IIS5.

4. Because the data parameters of the get request are exposed in the URL, the security is relatively low. If the password cannot be exposed, the get request cannot be used; in the post request, the request information is placed in the request header. It is safe and can be used.

6. Get limits the value of the data set in the From form to ASCLL characters, while Post supports the entire ISO10646 character set.

Note:

1. The get method is less secure than the Post method. If confidential information is included, it is recommended to use the 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;

The above is the detailed content of What are the differences between get requests and post requests?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn