lightmy.day

State-changing

PATCH HTTP Method

PATCH requests apply partial changes to a resource.

Meaning

The client sends a change document that partially modifies the target resource.

Common uses

Use PATCH when only part of a resource should change and the server supports the patch document format.

What to check

Check the patch media type, Accept-Patch support, validation errors, and conflict or precondition responses.

Example request

PATCH /articles/123 HTTP/1.1
Host: example.com
Content-Type: application/merge-patch+json

{"title":"Updated title"}

Properties

Safe
No. This method can change server state.
Idempotent
No. Repeating the request can create another effect.
Cacheable
Only when the response explicitly allows it.
Request body
Usually yes

References

Related HTTP methods

Related HTTP status codes