GET http://example.com/ HTTP/1.1
Host: example.com
Proxy-Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.200
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6
HTTP/1.1 200 OK
Via: 1.1 10.30.6.41 (Skyhigh Secure Web Gateway 12.2.11.49886)
Date: Sat, 22 Feb 2025 05:51:46 GMT
ETag: "84238dfc8092e5d9c0dac8ef93371a07:1736799080.121134"
X-Cache: MISS from 10.30.6.41
Content-Type: text/html
Accept-Ranges: bytes
Cache-Control: max-age=2520
Last-Modified: Mon, 13 Jan 2025 20:11:20 GMT
Proxy-Connection: Keep-Alive
Transfer-Encoding: chunked
<!doctype html>
<html>
<head>
<title>Example Domain</title>
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
body {
background-color: #f0f0f2;
margin: 0;
padding: 0;
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
div {
width: 600px;
margin: 5em auto;
padding: 2em;
background-color: #fdfdff;
border-radius: 0.5em;
box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);
}
a:link, a:visited {
color: #38488f;
text-decoration: none;
}
@media (max-width: 700px) {
div {
margin: 0 auto;
width: auto;
}
}
</style>
</head>
<body>
<div>
<h1>Example Domain</h1>
<p>This domain is for use in illustrative examples in documents. You may use this
domain in literature without prior coordination or asking for permission.</p>
<p><a href="https://www.iana.org/domains/example">More information...</a></p>
</div>
</body>
</html>
以下是对这个 HTTP 请求和响应的详细分析和解释:
HTTP 请求部分
GET http://example.com/ HTTP/1.1
Host: example.com
Proxy-Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.200
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6
1. 请求行
GET http://example.com/ HTTP/1.1
- GET:请求方法,表示客户端希望从服务器获取资源。
- http://example.com/:请求的 URI(统一资源标识符),指定了客户端希望访问的资源路径。
- HTTP/1.1:使用的 HTTP 协议版本。
2. 请求头
-
Host: example.com
指定请求的目标主机名(域名)。HTTP/1.1 要求必须包含此字段,用于支持虚拟主机(一个 IP 地址托管多个域名)。 -
Proxy-Connection:

226

被折叠的 条评论
为什么被折叠?



