1, GET request will be sent to the database request for data to obtain information, the request is like a database select operation, just to query the data, do not modify, add data, does not affect the content of the resource, that is, the request does not produce side effects. The results are the same no matter how many times you do it.
2, unlike get, the put request is to send data to the server to change the information, the request is like the database update operation, to modify the content of the data, but does not increase the type of data, and so on, no matter how many times put operation, the result is not different.
3. A POST request is similar to a put request, where data is sent to the server, but the request alters resources such as the type of data, and creates new content just like the insert operation of the database. Almost all of the current commit operations are requested by post.
4, delete request as the name implies, is used to delete a resource, the request is like a database delete operation.
As I said earlier, since both the put and post operations are sending data to the server, what is the difference between the two? Post primarily acts on a collection of resources (URLs), and put is mainly used on a specific resource (URL/XXX), the popular saying is, if the URL can be determined on the client, then you can use put, or post.
To sum up, we can understand the following:
1. POST /url Creation
2. Delete/url/xxx deleted
3. PUT /url/xxx update 4, GET /url/xxx View
Take 15 words Topicapi as an example, we will be at a glance at each request:
Create a theme using a POST request
Use a put request to modify a topic get content using a GET request
Get content to show
Delete a topic using delete request
Get, PUT, post, delete meanings and differences