ajax requests background data through the interface. Please give advice on when to use put, get, and post.
淡淡烟草味2017-05-19 10:27:20
get Get
post New
put Update
For more information, please Baidu "http verb"
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...
漂亮男人2017-05-19 10:27:20
The commonly used methods are get for querying and post for data modification (add, delete, modify)
怪我咯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
漂亮男人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
仅有的幸福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?
阿神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;