http请求的headers详解
关于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.