What is it?
PUT is an HTTP method commonly used to replace an existing resource with the data provided in the request.
Simple Definition: PUT usually sends the full updated version of a resource.
Software Knowledge → 03 · HTTP & APIs → PUT
An HTTP method commonly used to replace the current representation of a resource.
PUT is an HTTP method commonly used to replace an existing resource with the data provided in the request.
Simple Definition: PUT usually sends the full updated version of a resource.
Think of a resource as a form.
PUT is like replacing the entire completed form with a new version.
PUT is commonly used to:
PUT can be used in APIs that support full resource replacement.
Use:
PUT /api/customers/2001
Request Body:
{
"name": "ABC Trading",
"status": "Active",
"country": "Singapore"
}
The request sends the updated representation of customer 2001.
PUT identifies a resource and sends the replacement data for that resource.
Commonly represents a full replacement or full update.
Commonly changes only part of a resource.
PUT = Full Update
PATCH = Partial Update
| English Term | 中文 | Simple English | 中文小白理解 |
|---|---|---|---|
| PUT | 完整更新 | An HTTP method commonly used to replace a resource. | 通常用于完整更新或替换一个资源的 HTTP 方法。 |
| Resource | 资源 | The data or business object being replaced. | PUT 请求希望更新或替换的数据对象。 |
| Full Update | 完整更新 | Sending a complete updated representation of a resource. | 将一个资源更新后的完整内容发送给系统。 |
| Replace | 替换 | Replacing the current resource with a new version. | 用新的完整版本替换现有资源。 |
| Request Body | 请求体 | The data sent as the new resource representation. | PUT 请求中携带的新资源完整数据。 |
| Endpoint | 接口地址 | The address identifying the resource to update. | 用来标识需要更新资源的 API 地址。 |
| PATCH | 部分更新 | A method commonly used to change only some fields. | 通常只修改部分字段的 HTTP 方法。 |
| Response | 响应 | The result returned after the PUT request. | PUT 请求处理完成后返回的结果。 |
| Backend | 后端 | The software that performs the update. | 负责执行资源更新操作的软件部分。 |
| JSON | JSON 数据格式 | A common format for PUT request data. | PUT 请求中常用的数据格式。 |
PUT is commonly used for full resource updates.
PUT sends the new representation of an existing resource.
PUT and PATCH are both update methods, but they are commonly used differently.