關於http請求的headers詳解:這里以HTTP1.1為例結合postman返回的信息
1、Server →nginx/1.15.8 A name for the server 這是postman的解釋,這就是http的一個服務。服務是干什么的呢? 這里我就不多說了NGINX嘛!闊以上傳靜態文件啊 、反向代理服務器啥玩意兒的。
2、Date →Mon, xx Apr xxxx xx:xx:xx GMT postman解釋是:The date and time that the message was sent 解釋的很標准next one.
3、Content-Type →application/json;charset=UTF-8 postman解釋是:The mime type of this content 這個應該都知道就是返回內容的MIME類型
4、Transfer-Encoding →chunked The form of encoding used to safely transfer the entity to the user,Currently defined methods are:chunked,compress,deflate,gzip,identity 實體傳輸給用戶的編碼格式,有這五種 分塊、壓縮 等等,
Content-Encoding 和 Transfer-Encoding 二者經常會結合來用,其實就是針對 Transfer-Encoding 的分塊再進行 Content-Encoding壓縮。
5、Connection →keep-alive Options that are desired for the connection
6、Vary →Accept-Encoding Tells downstream proxies how to match future request headers to decide whether the cahed respose can be uesed rather than requesting a fresh one from the origin server. 告訴下游代理是使用緩存響應
還是從原始服務器請求,Accept-Encoding標頭可指示代理來存儲壓縮和非壓縮的版本資源。
7、Access-Control-Allow-Origin →* 一種解決資源跨域的策略
8、Access-Control-Allow-Methods →POST, GET, OPTIONS, DELETE,PUT
9、Access-Control-Max-Age →3600
10、X-Application-Context →application:dev:8080 Custom header
11、Access-Control-Allow-Headers →Origin,X-Requested-With, Content-Type, Accept 用於 preflight request (預檢請求)中。
12、X-Forwarded-Port →443 Custom header
13、Strict-Transport-Security →max-age=15724800; includeSubDomains )是一個安全功能,它告訴瀏覽器只能通過HTTPS訪問當前資源,而不是HTTP。
14、Content-Encoding →gzip The type of encoding used on the data.