search

Home  >  Q&A  >  body text

javascript - Ajax requests background data through the interface. When to use put, get, and post? Please give advice.

ajax requests background data through the interface. Please give advice on when to use put, get, and post.

滿天的星座滿天的星座2803 days ago529

reply all(7)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-05-19 10:27:20

    get Get
    post New
    put Update
    For more information, please Baidu "http verb"

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-19 10:27:20

    Obviously, you can guess the meaning just by looking at the English words... As mentioned above, post is generally used to submit information, and get gets...

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-19 10:27:20

    The commonly used methods are get for querying and post for data modification (add, delete, modify)

    reply
    0
  • 怪我咯

    怪我咯2017-05-19 10:27:20

    I think you can clearly distinguish the advantages and disadvantages between the three, and then it depends on the situation. There is no special rule on when to use which one

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-19 10:27:20

    This depends on whether the RESTful service is used. If not, generally only get and post submissions are required. If you use REST, there will be get, post, put, and delete. get: obtain data operation; post: create data operation; put: update data operation; delete: delete data operation; in fact, there are also head, options, trace, and connect methods; there are eight methods in total

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-19 10:27:20

    I think what kind of interface is given to you by the backend? It wants to give you an interface for getting parameters. Can you use post to submit? The backend says that this interface is accessed using get, and what are the parameters? Then you just use get access and bring the parameters! What's the use of worrying about it?

    reply
    0
  • 阿神

    阿神2017-05-19 10:27:20

    get acquisition, only short parameters and can be used in clear text, can be used when there are no restrictions in the background; post parameters are relatively long, or do not require clear text transmission, such as passwords, etc., can be used without restrictions in the background;

    reply
    0
  • Cancelreply