What is it?
A response is the message a server or API returns after processing a request.
It may contain data, a status, or an error.
Simple Definition: A response tells the client what happened.
Software Knowledge → 03 · HTTP & APIs → Response
The message returned after a request has been processed.
A response is the message a server or API returns after processing a request.
It may contain data, a status, or an error.
Simple Definition: A response tells the client what happened.
Think of a request as a question.
The response is the answer.
A response can:
Responses are used between:
Request:
GET /api/orders/1001Response:
HTTP/1.1 200 OK
{
"id": 1001,
"status": "Completed"
}The status code describes the result.
The body contains the returned data.
Status Code → Response Body → Client
The response completes the request-response cycle.
Response ≠ Request
Asks for something.
Returns the result.
| ENGLISH TERM | 中文 | SIMPLE ENGLISH | 中文小白理解 |
|---|---|---|---|
| Response | 响应 | The message returned after a request is processed. | 请求处理完成后返回的数据或结果。 |
| Request | 请求 | A message asking for data or an action. | 向系统请求数据或执行操作的信息。 |
| Status Code | 状态码 | A number showing the result of an HTTP request. | 表示 HTTP 请求处理结果的数字。 |
| Response Body | 响应体 | The main data returned inside a response. | 响应中真正返回的主要数据内容。 |
| Response Header | 响应头 | Extra information returned with the response. | 随响应一起返回的附加信息。 |
| Success | 成功 | A result showing the request was processed successfully. | 表示请求已成功处理的结果。 |
| Error | 错误 | A result showing something went wrong. | 表示请求处理过程中出现问题的结果。 |
| JSON | JSON 数据格式 | A common format used for response data. | API 响应中常用的结构化数据格式。 |
| Client | 客户端 | The side receiving the response. | 接收响应结果的一端。 |
| Server | 服务器 | The side processing the request and sending the response. | 处理请求并返回响应的一端。 |
A response is returned after a request.
Responses may contain data, status information, or errors.
The request and response together form one interaction.