以下为个人学习笔记和习题整理

  • # (1)、响应报文格式:

<version><status><reason-phrase>
<headers>
<entity-body>

  • # (2)、响应头报文:

Accept-Ranges
表明服务器是否支持指定范围请求及哪种类型的分段请求
Accept-Ranges: bytes

Access-Control-Allow-Origin
配置有权限访问资源的域
Access-Control-Allow-Origin: <origin>|*

Allow
对某网络资源的有效的请求行为,不允许则返回 405
Allow: GET, HEAD

Cache-Control
告诉所有的缓存机制是否可以缓存及哪种类型
Cache-Control: no-cache

Content-Encoding
web 服务器支持的返回内容压缩编码类型。
Content-Encoding: gzip

Content-Language
响应体的语言
Content-Language: en,zh

Content-Length
响应体的长度
Content-Length: 348

Content-Location
请求资源可替代的备用的另一地址
Content-Location: /index.htm

Content-Type
返回内容的 MIME 类型
Content-Type: text/html; charset=utf-8

Date
原始服务器消息发出的时间
Date: Tue, 15 Nov 2010 08:12:31 GMT

ETag
请求变量的实体标签的当前值
ETag: "737060cd8c284d8af7ad3082f209582d"

Location
用来重定向接收方到非请求 URL 的位置来完成请求或标识新的资源
Location: http://www.zcmhi.com/archives/94.html

Proxy-Authenticate
它指出认证方案和可应用到代理的该 URL 上的参数
Proxy-Authenticate: Basic

Refresh
应用于重定向或一个新的资源被创造,在 5 秒之后重定向(由网景提出,被大部分浏览器支持)
Refresh: 5; url=http://www.zcmhi.com/archives/94.html

Server
web 服务器软件名称
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux)

Set-Cookie
设置 Http Cookie Set-Cookie: UserID=JohnDoe; Max-Age=3600; Version=1

Strict-Transport-Security
设置浏览器强制使用 HTTPS 访问
max-age: x 秒的时间内 访问对应域名都使用 HTTPS 请求
includeSubDomains: 网站的子域名也启用规则
Strict-Transport-Security: max-age=1000; includeSubDomains

X-Frame-Options
配置页面是否能出现在 <frame>, <iframe>, <embed>, <object> 等标签中,防止点击劫持
X-Frame-Options: deny
SAMEORGIN:仅同源域名下的页面匹配时许可

X-XSS-Protection
配置 XSS 防护机制
X-XSS-Protection: 1; mode=block

HttpOnly:使 JavaScript 脚本无法获取 cookie,防止 xss 攻击。

X-Powered-By:可以知道 web 后端语言(但是可以修改)

更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Avenue-le 微信支付

微信支付

Avenue-le 支付宝

支付宝

Avenue-le beauty

beauty