Remember the similarities and differences between get and post in Ajax

Source: Internet
Author: User

The following are personal notes, if there are errors, please correct

Get and post are pretty much the same in terms of notation.

$.ajax ({    type:"get",//get    data:data,    success:function () {        /*some code*/    },    error:function  () {        /*some code*/    }});

This is roughly the same thing.

But they still have a clear gap:

1. The content obtained by get is cached by the browser, and post does not;

2. When a get sends a request, the parameters that accompany it are displayed directly behind the URL, and post is via the HTTP POST mechanism.

The Post method is implicit to the user by placing each field within the form with its contents in the HTML header, along with the URL address referred to by the Action property.

So this also derived a difference, get security is poor, if there is important content in the transmission, it will be exposed;

3. Get and post can transmit a significant difference in the amount of data, get words within 2k, and post is generally unrestricted.

Remember the similarities and differences between get and post in Ajax

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.