← HTTP & APIs Overview

Software Knowledge → 03 · HTTP & APIs → Body

PART III · HTTP & APIs

Body

The main data carried inside an HTTP request or response.

01 · What is it?

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.

02 · Think of it like...

Think of it like...

Think of an HTTP message as a package.

Headers are the labels.

The body is what is inside the package.

HTTP Message
→
Header
Information about the message
→
Body
Main message data
03 · What does it do?

What does it do?

A body carries the data that a server or client needs to read, process, or return.

JSON Data
Form Data
Text
File Data
API Results
Error Details
04 · Where is it used?

Where is it used?

Bodies commonly appear when a request or response needs to carry more than metadata.

POST Requests
PUT Requests
PATCH Requests
API Responses
File Uploads
Form Submissions
05 · Example

Example

POST /api/orders

{
  "customer_id": 2001,
  "quantity": 10
}

The body contains the order data the backend needs to process.

06 · How it connects

How it connects

Client→Request Body→API→Backend→Response Body→Client

The request body carries data into the system.

The response body carries data back to the client.

07 · Do Not Confuse

Do Not Confuse

Body

Contains the main message data.

Header

Contains additional information about the message.

Body = Main Data
Header = Metadata
08 · Topic Glossary

Topic Glossary

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 消息一起发送的附加信息。
JSONJSON 数据格式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。
09 · What to Remember

What to Remember

The body contains the main data of an HTTP message.

Request bodies send data to a system.

Response bodies return data to a client.

HTTP Message→Header + Body
↑