What is the difference between post get put delete

POST, DELETE, PUT, GET are like CRUD corresponding to the database (add, delete, modify, check)

Use standard:

    POST             /uri                创建

    GET              /uri/xxx            查询

    PUT              /uri/xxx            更新或创建
 
    DELETE           /uri/xxx            删除

A GET request is used to send a query data request to the server. It is only a query, and will not add or modify data, and will not affect the content of resources on the server. No matter how many times it is executed, the result after execution is the same, which is idempotent.

The PUT request is used to send data to the server, thereby changing the data and modifying the data content. But it will not increase the variety of data. No matter how many operations are performed, the result is the same, which is idempotent.

POST requests are similar to PUT requests. They all send data to the server, but changing the request will increase the types of data and create new content. Not idempotent.

DELETE request, used to delete a resource

What is the difference between PUT and POST?

    PUT和POST都是向服务器发送数据,

    但是POST主要是在一个集合资源之上(url),PUT主要作用在一个具体的资源之上(url/xxx)

Guess you like

Origin blog.csdn.net/unique_sir/article/details/121876075