← 03 · HTTP & APIs

Software Knowledge → 03 · HTTP & APIs → PATCH

PART III · HTTP & APIs

PATCH

An HTTP method commonly used to update part of an existing resource.

01 · What is it?

What is it?

PATCH is an HTTP method commonly used to change selected parts of an existing resource.

Simple Definition:
PATCH updates only the fields that need to change.

02 · Think of it like...

Think of it like...

Think of an existing form with ten fields.

If only the status changes, PATCH can send just the new status instead of the full form.

Existing Resource

name = ABC Trading
status = Pending
country = Singapore

PATCH

status = Active

Result

name = ABC Trading
status = Active
country = Singapore

03 · What does it do?

What does it do?

PATCH is commonly used to:

Change Status
Update One Field
Update Several Selected Fields
Modify Part of a Resource
04 · Where is it used?

Where is it used?

PATCH is commonly useful for:

Order Status
Approval Status
User Settings
Profile Changes
Quantity Changes
Workflow Updates
05 · Example

Example

Use:

PATCH /api/orders/1001

Request Body:

{
"status": "Approved"
}

Only the order status is being changed.

The other order fields do not need to be sent in this example.

06 · How it connects

How it connects

Client→PATCH→Resource Endpoint→Changed Fields→Backend→Update Resource→Response

PATCH focuses on the fields that need to change.

07 · Do Not Confuse

Do Not Confuse

PATCH

Commonly updates part of a resource.

PUT

Commonly sends a complete replacement or full update.

PATCH = Partial Update
PUT = Full Update

08 · Topic Glossary

Topic Glossary

ENGLISH TERM中文SIMPLE ENGLISH中文小白理解
PATCH部分更新An HTTP method commonly used to update part of a resource.通常用于修改资源部分字段的 HTTP 方法。
Partial Update部分更新Changing only selected fields of a resource.只修改资源中的部分字段。
Field字段One piece of information inside a resource.一个业务对象中的某一项数据。
Resource资源The data or object being updated.PATCH 请求需要修改的数据或业务对象。
Request Body请求体The changed values sent in the request.PATCH 请求中发送的需要修改的数据。
Endpoint接口地址The address identifying the resource to change.标识需要修改哪个资源的 API 地址。
PUT完整更新A method commonly used for full resource updates.通常用于完整更新资源的 HTTP 方法。
Status状态A field often changed using PATCH.经常通过 PATCH 修改的一类状态字段。
Backend后端The software that applies the requested changes.根据 PATCH 请求执行数据修改的软件部分。
Response响应The result returned after the update.部分更新完成后返回的结果。
09 · What to Remember

What to Remember

PATCH updates part of an existing resource.

PATCH is useful when only selected fields need to change.

PATCH and PUT are commonly used for different types of updates.

Final:
Existing Resource → PATCH → Selected Changes

↑