Index | Diary 2024-05-06

Host

指定服务器域名,客户端请求时

可以访问*同一台*服务器上的不同网站

Content-Length

Connection

    GET / HTTP/1.1
    Connection: Keep-live
    HTTP/1.1 200 OK
    ...
    Keep-Alive: timeout=10, max=500
    Connection: Keep-Alive
    ...

HTTP长连接: 只要一端没有提出断开,则保持TCP连接状态

Content-Type

用于服务器回应时,告诉客户端,本次数据是什么格式

Content-Type: text/html; Charset=utf-8

请求时,声明接收什么格式的数据

Accept: */*

Content-Encoding

说明数据的压缩方法,表明服务器返回的数据用什么格式压缩

Accept-Encoding: gzip, deflate

Content-Encoding: gzip