Skip to content
BENIBIX Learn

PATCH Request

Infrastructure🌐 NetworkingRequests and Responses

Also known as PATCH, HTTP PATCH, PATCH Method

A web request that changes only part of a thing. You send just the changes.

Think of it like

Think of it like a sticker on a page. It fixes one word and keeps the rest.

Example

Lucy changes her city in an app. It sends a PATCH with only the city, and her name and email stay the same.

Why it matters

Small edits stay small. Two people who edit different fields do not undo each other.

Definition

A PATCH request changes only part of a thing on the server. You send just the fields you want to change, and the rest stays as it was. That makes requests smaller than a PUT, which sends the whole thing. Whether sending the same PATCH twice is safe depends on how it is written. Setting a field is safe to repeat; adding one to a counter is not.

Example code

http
PATCH /api/users/42 HTTP/1.1
Content-Type: application/json

{"city": "Bristol"}
Only the city is sent, and only the city changes.

Common mistake

Assuming every PATCH is safe to retry. A PATCH that adds to a balance adds twice.

Key takeaways

  1. 1
    Changes a part. The rest stays.
  2. 2
    Send only changes. Smaller than PUT.
  3. 3
    Retry with care. Depends on the change.

Compare

Learn it properly