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



说我在Firefox中输入"stackoverflow.com"。

我知道我正在发送一个 HTTP GET 请求。但是,实际的 HTML 标记位于响应中的什么位置?它是否在某个标题中,例如内容类型?还是位于其他地方?

谢谢。

HTTP 响应具有以下数据:

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

Html 位于响应正文中

HTML 位于响应正文中。

Hypertext_Transfer_Protocol中有一个例子,维基

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>

最新更新