[-Project essay-] differences between Ajax get and post

Source: Internet
Author: User

The project encountered a strange problem when using Ajax. After the Administrator logged on to the system, he managed his account and changed his password, after he leaves the system, he finds that he cannot log on with the new password, but he can only log on with the original password. Where is the problem?

PassCodeCheck. I found that the problem occurred when I used the get method when sending the request. It was normal after I changed it to post. What is the difference between get and post?

When the get method is used, the browser attaches each form field element and its data to the resource path in the request line according to the URL parameter format. There is a limit on the amount of data transmitted by parameters in the get method, it is generally limited to 1 kb. The most important thing is that it will be cached by the client's browser, so that others can read the customer's data from the browser's historical records, for example, account and password. Therefore, in some cases, the get method may cause serious security problems.

When the POST method is used, the browser sends the form field elements and their data to the Web server as the entity content of the HTTP message, rather than as the URL address parameter, the amount of data transmitted in post mode is much larger than that transmitted in get mode.

In short, the get method delivers a small amount of data, high processing efficiency, low security, and will be cached, whereas the POST method does not.

--------------------------------------------------

TIPS: To avoid caching, you can add a timestamp parameter after the request.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.