What is it?
The body is the main content carried inside some HTTP requests and responses.
It often contains data the receiving system needs to process.
Simple Definition: The body carries the main data of the HTTP message.
Software Knowledge → 03 · HTTP & APIs → Body
The main data carried inside an HTTP request or response.
The body is the main content carried inside some HTTP requests and responses.
It often contains data the receiving system needs to process.
Simple Definition: The body carries the main data of the HTTP message.
Think of an HTTP message as a package.
Headers are the labels.
The body is what is inside the package.
A body carries the data that a server or client needs to read, process, or return.
Bodies commonly appear when a request or response needs to carry more than metadata.
{
"customer_id": 2001,
"quantity": 10
}The body contains the order data the backend needs to process.
The request body carries data into the system.
The response body carries data back to the client.
Contains the main message data.
Contains additional information about the message.
| English Term | 中文 | Simple English | 中文小白理解 |
|---|---|---|---|
| Body | 请求体 / 响应体 | The main data carried inside an HTTP message. | HTTP 请求或响应中真正携带的主要数据。 |
| Request Body | 请求体 | Data sent from the client to the server. | 客户端发送给服务器的主要请求数据。 |
| Response Body | 响应体 | Data returned from the server to the client. | 服务器返回给客户端的主要响应数据。 |
| Header | 请求头 / 响应头 | Extra information attached to the HTTP message. | 随 HTTP 消息一起发送的附加信息。 |
| JSON | JSON 数据格式 | A common format used inside API bodies. | API 请求体和响应体中常用的数据格式。 |
| Payload | 有效载荷 / 数据内容 | The main data being transmitted. | 一次请求或响应真正传输的主要业务数据。 |
| POST | 创建 / 提交 | A method that often sends data in the request body. | 经常通过请求体发送数据的 HTTP 方法。 |
| PATCH | 部分更新 | A method that often sends changed fields in the body. | 经常在请求体中发送需要修改字段的方法。 |
| Content-Type | 内容类型 | A header that tells the format of the body. | 用来说明 Body 是什么数据格式的 Header。 |
The body contains the main data of an HTTP message.
Request bodies send data to a system.
Response bodies return data to a client.