PATCHActive
PATCH applies partial modifications to a resource. Unlike PUT (which replaces entirely), PATCH only changes the specified fields. PATCH is not idempotent by default – sending the same patch twice may have cumulative effects depending on the patch format used.
Properties
| Safe | No | Safe methods don't change server state. They are read-only. |
| Idempotent | No | Idempotent methods produce the same result if called once or multiple times. |
| Cacheable | No | Cacheable responses may be stored and reused for equivalent requests. |
| Request Body | Yes | Whether a request body is allowed / expected. |
| Response Body | Yes | Whether a response body is expected. |
Description
The PATCH method applies partial modifications to a resource. PATCH is similar to PUT but only modifies the specified parts of the resource rather than replacing it entirely. JSON Merge Patch (RFC 7396) and JSON Patch (RFC 6902) are common formats.
Examples
Partial update
http
PATCH /api/users/42 HTTP/1.1
Host: api.example.com
Content-Type: application/merge-patch+json
{"role": "admin"}