关于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.

 

内容来源于网络如有侵权请私信删除
你还没有登录,请先登录注册
  • 还没有人评论,欢迎说说您的想法!