所谓幂等,通俗来讲就是不管执行多少次,所造成的后果都一样,比如 DELETE /my/resource/123 不管执行多少遍都是删除 123 这个资源,不会造成把 456 给删了;再如 POST /my/resource 数据 name=张三&age=60 每执行一次就加一个张三,这是非幂等的。那回到 PATCH 上,如何理解它是非幂等呢,功能是更新部分内容没错,但对它的定义这个是不全的,完整描述如下: The PATCH Method The PATCH method requests that a set of changes described in the request entity be applied to the resource identified by the Request- URI. The set of changes is represented in a format called a "patch document" identified by a media type. If the Request-URI does not point to an existing resource, the server MAY create a new resource, depending on the patch document type (whether it can logically modify a null resource) and permissions, etc. 其中有很重要一句说明,如果 URI 对应的资源不存在,服务端可以创建一个新资源。 详见 https://tools.ietf.org/html/r...