"example.com" 在 GET 请求中指的是什么?

What does the "example.com" refer to in a GET request?

GET 请求中的 "example.com" 指的是什么,例如这个 F5 健康监视器示例:

GET /somefolder HTTP/1.1\r\nHost: www.example.com\r\nConnection: Close\r\n\r\n

GET / [uri path]
HTTP/1.1 [http encoding]
[Carriage Return/LineFeed]
Host: [required for http 1.1 to specify the next part]
www.example.com  <**?????**>
Connection: Close [command to end query request]
[CR/LF/CR/LF]

www.example.com is the hostname.

Host header 机制的目的,特别是强制其出现在 HTTP/1.1 请求中的要求,是为了加快从为每个请求分配新 IP 地址的转变。虚荣 URL.

参考:Key Differences between HTTP/1.0 and HTTP/1.1

简单地说,就是说请求是针对哪个域的。您正在请求路径 /,但单个服务器可能为数百个域提供服务,因此它需要知道您需要 哪个 /