You’re reading the English version of this content since no translation exists yet for this locale. Help us translate this article!
The HTTP PATCH request method applies partial modifications to a resource.
PUT method only allows complete replacement of a document. Unlike
PATCH is not idempotent, meaning successive identical patch requests may have different effects. However, it is possible to issue
PATCH requests in such a way as to be idempotent.
PUT) may have side-effects on other resources.
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||Yes|
|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 by any 2xx status code.
HTTP/1.1 204 No Content Content-Location: /file.txt ETag: "e0023aa4f"
|RFC 5789: PATCH||PATCH Method for HTTP|