URL Brief
Relative URL page from the current
Jump from absolute URL or other page from the current page
HTTPD version <0.9 text> <1.0, method, mime, weak cache> <1.1 persistent connection> <2.0, mime, spdy, cache, method>
HTTPD characteristics: stateless text encoding protocol <telnet, curl, enlinks>
Track user source mechanisms: cookie (heavy cookie, light cookie), session
Cookie Category
Cookie working mechanisms: random number that uniquely identifies the user
Light cookie application: data structures stored cookie and session mapping
HTTP transactions: a request and response
Transactional metadata: headers
Entity: entity-body
Detailed HTTP request response packet:
<method> <url> <version>
<header>
...
<header>
Empty 1
2 empty
<entity-body>
<version> <status> <reason-phrase>
<header>
...
<header>
Empty 1
2 empty
<entity-body>
100 Information
200 OK Success
301 Moved Permantly permanent 302 Found 304 Not Modified temporary conditions
401 WWW-Authenticate challenge authentication 403 Forbidden 404 Not Found do not have permission to access resources not
500 Internal Server Error internal service error 502 Bad Gateway Bad Gateway
Uniform Resource Locator identifies the location of each URL resource URL is a subset of URI
Relative URL: relative URL of the current page (relative path: starting from the current working directory path)
Absolute URL: used for cross-reference station or the current page (absolute path: a / initial path)
HTTPD version
HTTPD characteristics
Track user source mechanism
Cookie works
Secondary communication:
服务器 接收随机数(令牌) <-- 客户端 将访问的服务器首次所发的令牌发给服务器,用于标明自己的身份
Cookie分类
Session:<轻cookie:减小隐私信息丢失的可能性>,在服务器端在进程内存中维护Session
HTTP事务 一次httpd请求和响应
事务元数据:(起始行+headers)
实体:entity-body部分
HTTP请求响应报文详解
请求报文
响应报文
method 客户端告诉服务器做什么
status code 服务器告诉客户端结果
reason-phrase 原因短语
反向代理:将自己扮演为服务端接收请求,支持缓存,拆封报文并重新封装
正向代理:将自己扮演为客户端发起请求
重定向
条件式请求
用户质询认证
Forbidden 请求被禁止,IP控制或用户访问控制不通过时
404 用户请求一个不存在的资源
错误网关:
headers 请求和响应首部: 标记请求或响应的属性 , 事务交换的元数据信息
负载均衡调度时,可以根据首部调度
1、首部可以有多个
2、首部的格式:Directive: value
首部分类
通用首部
请求首部
自己可接受的特性
条件式请求首部: 缓存相关
安全请求首部
代理请求首部
响应首部
实体首部
示例