Suggest an editImprove this articleRefine the answer for “What is PATCH used for?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**PATCH** is an **HTTP method** used to **partially update a resource on the server**. In simple terms, PATCH is needed to change only part of the data, not the whole object. **Key point:** unlike PUT, PATCH sends only the fields being changed, while the rest of the resource stays unchanged.Shown above the full answer for quick recall.Answer (EN)Image**PATCH** is an **HTTP method** used to **partially update a resource on the server**. In simple terms: **PATCH is needed to change only part of the data, not the whole object**. --- ## The main purpose of PATCH PATCH is used when you need to: - change one or a few fields of a resource - leave the rest of the data untouched - perform a "targeted" update The typical meaning of PATCH: > "Change these specific fields, leave everything else as is" --- ## How PATCH works 1. The client sends an HTTP request with the **PATCH** method 2. The request body carries **only the fields being changed** 3. The server: - finds the resource - updates **only the specified fields** 4. The server returns an HTTP response --- ## Where data is sent with PATCH Data is sent: - **in the request body** - usually as JSON An example of what the request means: ```json { "email": "new_email@example.com" } ``` The rest of the resource's fields **do not change**. --- ## PATCH vs PUT (very important) This is a common interview question. - **PUT** - a full replacement of the resource - the whole object must be sent - a missing field may be removed - **PATCH** - a partial update - only the changed fields are sent - safer for small changes A way to remember it: - **PUT** - "replace everything" - **PATCH** - "fix a piece" --- ## Properties of PATCH - usually **not idempotent** (depends on the implementation) - not cached - used in REST APIs for updates --- ## Real-life example PATCH is like: - changing a phone number in a profile - fixing a typo in a text - updating one setting You are **not rewriting everything**, you are **changing only what's needed**.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.