Property |
Get method |
Post method |
History: |
Usually the data sent using the Get method is saved as part of the URL by the browser. |
Data submitted using the Post method will not be part of the URL, but will not be saved by the browser. |
Bookmark: |
The Get method may be saved by the browser as a bookmark (bookmark) |
The Post method does not |
Fallback and resubmit: |
Pages that use the Get method can be rolled back and re-executed without notifying the user |
The Post method notifies the user to submit again |
Form encoding Type: |
Get submit data only supports application/x-www-form-urlencoded |
Post Support application/x-www-form-urlencoded and Multipart/form-data |
Parameters: |
Because the get parameters are usually followed by the URL, the supported data size is generally 2K, some servers can support to 64K. This is the real reason why many Web pages hang out over 64K. Because the server is limited. |
Send a parameter, or it can be a file, the size is theoretically unlimited. |
Being attacked: |
The Get method submits data that is easily hacked and implemented by scripting abductions. |
Post method is less susceptible to hacking than get methods |
Data type Restrictions: |
Get method submission data can only be text data |
The Post method is unrestricted, and the binary file is also available. |
Security: |
The Get method is less secure than the Post method because the data is visible as part of the URL. and the browser has historical access records. |
The Post method has a higher security relative to get. Because the parameter data cannot be stored in the history access record by the browser as part of the URL. |
form data Length: |
Because the form data is part of the URL, the URL length is usually limited. |
There is no limit to the Post method. |
Availability of: |
The Get method is not typically used to send passwords with sensitive information. But I found that there are still a lot of sites with get to implement login. such as the XXXX community, it put the login method in a jquery complete JavaScript script, with a GET request to complete. |
The Post method can be used to send passwords and other sensitive information. |
Visibility of: |
The Get method is visible to all people |
The variables of the Post method are not visible in the URL |
Cache: |
The Get method is cached by default, which is why it is often time to use the Get method to get the data behind a timestamp. |
The Post method is not cached by default. Unless the response header sets the Cache-control or Expires property value. |
Maximum value of the variable: |
Get support is 7,607 characters maximum |
The Post method supports a maximum value of 8MB |
Application: |
Get the most commonly used occasions is to get the data, the browser gets the Web page when most of the implementation through the Get method, most browser download also use Get method to get the file |
Post is used primarily to submit data to the server. |