The HTTP PATCH request method applies partial modifications to a resource.
PUT method is already defined to overwrite a resource with a complete new body, and for the
POST method there is no standard way to discover patch format support. Unlike
PUT, but like
PATCH is not idempotent, meaning successive identical patch requests will have different effects.
Another (implicit) indication that PATCH is allowed, is the presence of the
Accept-Patch header, which specifies the patch document formats accepted by the server.
|Request has body||Yes|
|Successful response has body||No|
|Allowed in HTML forms||No|
PATCH /file.txt HTTP/1.1
PATCH /file.txt HTTP/1.1 Host: www.example.com Content-Type: application/example If-Match: "e0023aa4e" Content-Length: 100 [description of changes]
A successful response is indicated with a
204 response code, because the response does not carry a message body.
HTTP/1.1 204 No Content Content-Location: /file.txt ETag: "e0023aa4f"
|RFC 5789: PATCH||PATCH Method for HTTP|