Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

HTTP-响应报文

四部分组成

  • 响应行

    协议版本 状态码 状态码的原因短语
    
    • 状态码
      • 200 —— 成功
  • 响应头部Header

    字段A: 值A
    字段B: 值B
    ......
    
    • 详见“响应Header”
  • 空行

  • 响应数据

    • 比如html文档

一个例子

HTTP/1.1 200 OK
Content-Encoding: gzip
Content-Type: text/html;charset=utf-8

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <title>Document</title>
</head>
<body>
    <p>this is http response</p>
</body>
</html>