以下是一个返回 404 状态码的示例:
HTTP/1.1 404 Not Found
Content-Type: application/json
{
"error": "Resource not found"
}
以下是一个返回 JSON 格式的示例:
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 1,
"name": "John Smith",
"email": "john@example.com"
}
以下是一个带有时间戳信息的示例:
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": "success",
"data": {
"id": 1,
"name": "John Smith",
"email": "john@example.com"
},
"timestamp": "2021-07-01T09:22:57.000Z"
}
以下是一个带有分页信息的示例:
HTTP/1.1 200 OK
Content-Type: application/json
{
"status":