HTTP中包含的网页的实际HTML标记在哪里?

问题描述 投票:0回答:2

例如,我在Firefox中键入“ stackoverflow.com”。

我知道我正在发送HTTP GET请求。但是,响应中实际的HTML标记在哪里?是否在特定的标头(如content-type)中?还是位于其他地方?

谢谢。

html http browser get
2个回答
0
投票

HTTP响应具有以下数据:

  • HTTP版本
  • 状态码+有时是人类可读的状态字符串
  • 标题
  • 身体

HTML在响应正文中


0
投票

HTML是响应正文。

Hypertext_Transfer_Protocol, wiki中有一个例子

Web Broswer阅读响应消息。

HTTP/1.1 200 OK
Date: Mon, 23 May 2005 22:38:34 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 138
Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
Server: Apache/1.3.3.7 (Unix) (Red-Hat/Linux)
ETag: "3f80f-1b6-3e1cb03b"
Accept-Ranges: bytes
Connection: close

<html>
  <head>
    <title>An Example Page</title>
  </head>
  <body>
    <p>Hello World, this is a very simple HTML document.</p>
  </body>
</html>
© www.soinside.com 2019 - 2024. All rights reserved.