What is the difference between PUT and PATCH?

Answer

PUT replaces a resource entirely with the provided representation. If you send PUT /users/42 with { "name": "Alice" }, all fields not included in the body are set to null/default. PUT requires the client to send the complete resource — you must first GET the resource, modify it, then PUT the full updated version. PATCH applies a partial update — only the fields included in the body are changed. PATCH /users/42 with { "name": "Alice" } changes only the name; all other fields remain unchanged. PATCH is more bandwidth-efficient for large resources where only a small field changes. JSON Patch (RFC 6902) formalizes PATCH operations: [{ "op": "replace", "path": "/name", "value": "Alice" }]. In practice, PATCH is more commonly used for partial updates in modern APIs.