发信人: kenmlee()
整理人: kenmlee(2000-01-03 11:02:48), 站内信件
|
本版将逐步将一些比较重要的RFC原文和部分译文发布
步骤是先发布一些较常用的应用层标准协议
接下来发布一些基本底层协议
最后发布较受关注但还未有标准的技术相关的RFC.
以下英文为原文,译文和说明以#开头,以/#结尾
Network Working Group R. Fielding
Request for Comments: 2068 UC Irvine
Category: Standards Track J. Gettys
J. Mogul
DEC
H. Frystyk
T. Berners-Lee
MIT/LCS
January 1997
Hypertext Transfer Protocol -- HTTP/1.1
#这些关于文档的说明就不译了/#
Status of this Memo
This document specifies an Internet standards track protocol for th e
Internet community, and requests discussion and suggestions for
improvements. Please refer to the current edition of the "Internet
Official Protocol Standards" (STD 1) for the standardization state
and status of this protocol. Distribution of this memo is unlimite d.
Abstract
The Hypertext Transfer Protocol (HTTP) is an application-level
protocol for distributed, collaborative, hypermedia information
systems. It is a generic, stateless, object-oriented protocol which
can be used for many tasks, such as name servers and distributed
object management systems, through extension of its request methods .
A feature of HTTP is the typing and negotiation of data
representation, allowing systems to be built independently of the
data being transferred.
HTTP has been in use by the World-Wide Web global information
initiative since 1990. This specification defines the protocol
referred to as "HTTP/1.1".
#目录
1 介绍
2 语法表示
3 协议参数
3.1 HTTP版本
3.2 URI唯一资源标识
3.3日期时间格式
3.4字符集
3.5内容编码
3.6传输编码
3.7媒体类型
3.8产品标识
3.9性质取值
3.10语言标示
3.11实体标示
3.12范围单位
4 HTTP消息
4.1消息类型
4.2消息头
4.3消息体
4.4消息长度
4.5一般头域
5 请求
5.1请求行
5.1.1方法
5.1.2请求URI
5.2请求的资源标识
5.3请求头域
6 响应
6.1状态行
6.1.1状态码和原因段
6.2响应头域
7 实体
7.1实体头域
7.2实体体
7.2.1类型
7.2.2长度
8 连接
8.1永久连接
8.1.1 目的
8.1.2 操作概述
8.1.3 代理服务器
8.1.4 实际考虑
8.2消息传输要求
9 方法定义
9.1 安全和 Idempotent(?不知如何译好) 方法
9.1.1 安全方法
9.1.2 Idempotent 方法
9.2 OPTION
9.3 GET
9.4 HEAD
9.5 POST
9.6 PUT
9.7 DELETE
9.8 TRACE
10 状态码定义
10.1 信息 Informational 1xx
10.1.1 100 Continue 继续
10.1.2 101 Switching Protocols 交换协议
10.2 成功 Successful 2xx
10.2.1 200 OK
10.2.2 201 Created 已创建
10.2.3 202 Accepted 已接受
10.2.4 203 Non-Authoritative Information 未授权信息
10.2.5 204 No Content 无内容
10.2.6 205 Reset Content 内容重置
10.2.7 206 Partial Content 部分内容
10.3 从定向 Redirection 3xx
10.3.1 300 Multiple Choices 多选
10.3.2 301 Moved Permanently 永久移动
10.3.3 302 Moved Temporarily 临时移动
10.3.4 303 See Other 参看其它
10.3.5 304 Not Modified 未改过
10.3.6 305 Use Proxy 使用代理
10.4 客户错误 Client Error 4xx
10.4.1 400 Bad Request 错误请求
10.4.2 401 Unauthorized 未授权
10.4.3 402 Payment Required 支付请求
10.4.4 403 Forbidden 禁止访问
10.4.5 404 Not Found 不存在
10.4.6 405 Method Not Allowed 不允许的方法
10.4.7 406 Not Acceptable 请求不可接受
10.4.8 407 Proxy Authentication Required 要求代理授权
10.4.9 408 Request Timeout 请求超时
10.4.10 409 Conflict 冲突
10.4.11 410 Gone 已不在
10.4.12 411 Length Required 要求长度
10.4.13 412 Precondition Failed 预处理失败
10.4.14 413 Request Entity Too Large 请求实体太大
10.4.15 414 Request-URI Too Large 请求资源太大
10.4.16 415 Unsupported Media Type 不支持的媒体类型
10.5 服务器错误 Server Error 5xx
10.5.1 500 Internal Server Error 服务器内部错
10.5.2 501 Not Implemented 未实现
10.5.3 502 Bad Gateway 网关错误
10.5.4 503 Service Unavailable 服务不可得
10.5.5 504 Gateway Timeout 网关超时
10.5.6 505 HTTP Version Not Supported 不支持的HTTP版本
11 存取授权
11.1 基本授权策略
11.2 摘要授权策略
12 内容协商
12.1 服务器驱动的协商
12.2 代理驱动的协商
12.3 透明协商
13 HTTP缓存
13.1.1 缓存的正确性
13.1.2 警告
13.1.3 缓存控制机制
13.1.4 显式用户代理警告
13.1.5 异常的规则和警告
13.1.6 客户控制行为
13.2 超期模型
13.2.1 服务器指定超期
13.2.2 启发式(Heuristic)超期
13.2.3 时间计算
13.2.4 超期计算
13.2.5 无二意性超期值
13.2.6 无二意性多响应
13.3 确认模型
13.3.1 最后修改日期
13.3.2 实体标示缓存验证器
13.3.3 弱验证器和强验证器
13.3.4 何时使用实体标示的最后修改日期的规则
13.3.5 不验证条件
13.4 可缓存响应
13.5 从缓存构造响应
13.5.1 端到端(End-To-end)和跳到跳(Hop-by-hop)头部
13.5.2 不可修改头部
13.5.3 组合头部
13.5.4 组合字节范围
13.6 缓存协商响应
13.7 共享和非共享缓存
13.8 错误或不完全响应缓存的行为
13.9 GET和HEAD的副作用
13.10 更新或删除后的不合法性
13.11 强制直写(Write-Through)
13.12 缓存覆盖
13.13 历史列表
14 头部域定义
14.1 Accept
14.2 Accept-Charset
14.3 Accept-Encoding
14.4 Accept-Language
14.5 Accept-Ranges
14.6 Age
14.7 Allow
14.8 Authorization
14.9 Cache-Control
14.9.1 什么是可缓存的
14.9.2 缓存保存什么
14.9.3 基本超期机制的修正
14.9.4 缓存重验证和重载入的控制
14.9.5 不转换指令
14.9.6 扩展缓存控制
14.10 Connection
14.11 Content-Base
14.12 Content-Encoding
14.13 Content-Language
14.14 Content-Length
14.15 Content-Location
14.16 Content-MD5
14.17 Content-Range
14.18 Content-Type
14.19 Date
14.20 ETag
14.21 Expires
14.22 From
14.23 Host
14.24 If-Modified-Since
14.25 If-Match
14.26 If-None-Match
14.27 If-Range
14.28 If-Unmodified-Since
14.29 Last-Modified
14.30 Location
14.31 Max-Forwards
14.32 Pragma
14.33 Proxy-Authenticate
14.34 Proxy-Authorization
14.35 Public
14.36 Range
14.36.1 Byte Ranges
14.36.2 Range Retrieval Requests
14.37 Referer
14.38 Retry-After
14.39 Server
14.40 Transfer-Encoding
14.41 Upgrade
14.42 User-Agent
14.43 Vary
14.44 Via
14.45 Warning
14.46 WWW-Authenticate
15 安全考虑
15.1 客户授权
15.2 提供授权策略选择
15.3 服务器日志信息的滥用
15.4 敏感数据的传输
15.5 基于文件和路径名的攻击
15.6 个人信息
15.7 连接到Accept头部域的隐秘发布
15.8 DNS哄骗(Spoofing)
15.9 头部定位和哄骗
16 Acknowledgments
17 References
18 Authors' Addresses
19 附录
19.1 Internet 媒体类型 messag/http
19.2 Internet 媒体类型 multipart/byteranges
19.3 容错应用
19.4 HTTP实体和MIME实体的区别
19.4.1 转换到规范形式
19.4.2 数据格式的转换
19.4.3 内容编码介绍(Content-Encoding)
19.4.4 非内容传输编码(Content-Transfer-Encoding)
19.4.5 在多部分(Multipart)消息体中HTTP头域
19.4.6 传输编码介绍(Transfer-Encoding)
19.4.7 MIME版本
19.5 从HTTP/1.0的改变
19.5.1 向简单多主(Multi-homed)Web服务器和保留IP地址的改变
19.6 附加特性
19.6.1 附加请求方法
19.6.2 附加头域定义
19.7 与以前版本的兼容
19.7.1 与HTTP/1.0永久连接的兼容
/#
Table of Contents
1 Introduction.............................................7
1.1 Purpose ..............................................7
1.2 Requirements .........................................7
1.3 Terminology ..........................................8
1.4 Overall Operation ...................................11
2 Notational Conventions and Generic Grammar..............13
2.1 Augmented BNF .......................................13
2.2 Basic Rules .........................................15
3 Protocol Parameters.....................................17
3.1 HTTP Version ........................................17
3.2 Uniform Resource Identifiers ........................18
3.2.1 General Syntax ...................................18
3.2.2 http URL .........................................19
3.2.3 URI Comparison ...................................20
3.3 Date/Time Formats ...................................21
3.3.1 Full Date ........................................21
3.3.2 Delta Seconds ....................................22
3.4 Character Sets ......................................22
3.5 Content Codings .....................................23
3.6 Transfer Codings ....................................24
3.7 Media Types .........................................25
3.7.1 Canonicalization and Text Defaults ...............26
3.7.2 Multipart Types ..................................27
3.8 Product Tokens ......................................28
3.9 Quality Values ......................................28
3.10 Language Tags ......................................28
3.11 Entity Tags ........................................29
3.12 Range Units ........................................30
4 HTTP Message............................................30
4.1 Message Types .......................................30
4.2 Message Headers .....................................31
4.3 Message Body ........................................32
4.4 Message Length ......................................32
4.5 General Header Fields ...............................34
5 Request.................................................34
5.1 Request-Line ........................................34
5.1.1 Method ...........................................35
5.1.2 Request-URI ......................................35
5.2 The Resource Identified by a Request ................37
5.3 Request Header Fields ...............................37
6 Response................................................38
6.1 Status-Line .........................................38
6.1.1 Status Code and Reason Phrase ....................39
6.2 Response Header Fields ..............................41
7 Entity..................................................41
7.1 Entity Header Fields ................................41
7.2 Entity Body .........................................42
7.2.1 Type .............................................42
7.2.2 Length ...........................................43
8 Connections.............................................43
8.1 Persistent Connections ..............................43
8.1.1 Purpose ..........................................43
8.1.2 Overall Operation ................................44
8.1.3 Proxy Servers ....................................45
8.1.4 Practical Considerations .........................45
8.2 Message Transmission Requirements ...................46
9 Method Definitions......................................48
9.1 Safe and Idempotent Methods .........................48
9.1.1 Safe Methods .....................................48
9.1.2 Idempotent Methods ...............................49
9.2 OPTIONS .............................................49
9.3 GET .................................................50
9.4 HEAD ................................................50
9.5 POST ................................................51
9.6 PUT .................................................52
9.7 DELETE ..............................................53
9.8 TRACE ...............................................53
10 Status Code Definitions................................53
10.1 Informational 1xx ..................................54
10.1.1 100 Continue ....................................54
10.1.2 101 Switching Protocols .........................54
10.2 Successful 2xx .....................................54
10.2.1 200 OK ..........................................54
10.2.2 201 Created .....................................55
10.2.3 202 Accepted ....................................55
10.2.4 203 Non-Authoritative Information ...............55
10.2.5 204 No Content ..................................55
10.2.6 205 Reset Content ...............................56
10.2.7 206 Partial Content .............................56
10.3 Redirection 3xx ....................................56
10.3.1 300 Multiple Choices ............................57
10.3.2 301 Moved Permanently ...........................57
10.3.3 302 Moved Temporarily ...........................58
10.3.4 303 See Other ...................................58
10.3.5 304 Not Modified ................................58
10.3.6 305 Use Proxy ...................................59
10.4 Client Error 4xx ...................................59
10.4.1 400 Bad Request .................................60
10.4.2 401 Unauthorized ................................60
10.4.3 402 Payment Required ............................60
10.4.4 403 Forbidden ...................................60
10.4.5 404 Not Found ...................................60
10.4.6 405 Method Not Allowed ..........................61
10.4.7 406 Not Acceptable ..............................61
10.4.8 407 Proxy Authentication Required ...............61
10.4.9 408 Request Timeout .............................62
10.4.10 409 Conflict ...................................62
10.4.11 410 Gone .......................................62
10.4.12 411 Length Required ............................63
10.4.13 412 Precondition Failed ........................63
10.4.14 413 Request Entity Too Large ...................63
10.4.15 414 Request-URI Too Long .......................63
10.4.16 415 Unsupported Media Type .....................63
10.5 Server Error 5xx ...................................64
10.5.1 500 Internal Server Error .......................64
10.5.2 501 Not Implemented .............................64
10.5.3 502 Bad Gateway .................................64
10.5.4 503 Service Unavailable .........................64
10.5.5 504 Gateway Timeout .............................64
10.5.6 505 HTTP Version Not Supported ..................65
11 Access Authentication..................................65
11.1 Basic Authentication Scheme ........................66
11.2 Digest Authentication Scheme .......................67
12 Content Negotiation....................................67
12.1 Server-driven Negotiation ..........................68
12.2 Agent-driven Negotiation ...........................69
12.3 Transparent Negotiation ............................70
13 Caching in HTTP........................................70
13.1.1 Cache Correctness ...............................72
13.1.2 Warnings ........................................73
13.1.3 Cache-control Mechanisms ........................74
13.1.4 Explicit User Agent Warnings ....................74
13.1.5 Exceptions to the Rules and Warnings ............75
13.1.6 Client-controlled Behavior ......................75
13.2 Expiration Model ...................................75
13.2.1 Server-Specified Expiration .....................75
13.2.2 Heuristic Expiration ............................76
13.2.3 Age Calculations ................................77
13.2.4 Expiration Calculations .........................79
13.2.5 Disambiguating Expiration Values ................80
13.2.6 Disambiguating Multiple Responses ...............80
13.3 Validation Model ...................................81
13.3.1 Last-modified Dates .............................82
13.3.2 Entity Tag Cache Validators .....................82
13.3.3 Weak and Strong Validators ......................82
13.3.4 Rules for When to Use Entity Tags and Last-
modified Dates..........................................85
13.3.5 Non-validating Conditionals .....................86
13.4 Response Cachability ...............................86
13.5 Constructing Responses From Caches .................87
13.5.1 End-to-end and Hop-by-hop Headers ...............88
13.5.2 Non-modifiable Headers ..........................88
13.5.3 Combining Headers ...............................89
13.5.4 Combining Byte Ranges ...........................90
13.6 Caching Negotiated Responses .......................90
13.7 Shared and Non-Shared Caches .......................91
13.8 Errors or Incomplete Response Cache Behavior .......91
13.9 Side Effects of GET and HEAD .......................92
13.10 Invalidation After Updates or Deletions ...........92
13.11 Write-Through Mandatory ...........................93
13.12 Cache Replacement .................................93
13.13 History Lists .....................................93
14 Header Field Definitions...............................94
14.1 Accept .............................................95
14.2 Accept-Charset .....................................97
14.3 Accept-Encoding ....................................97
14.4 Accept-Language ....................................98
14.5 Accept-Ranges ......................................99
14.6 Age ................................................99
14.7 Allow .............................................100
14.8 Authorization .....................................100
14.9 Cache-Control .....................................101
14.9.1 What is Cachable ...............................103
14.9.2 What May be Stored by Caches ...................103
14.9.3 Modifications of the Basic Expiration Mechanism 104
14.9.4 Cache Revalidation and Reload Controls .........105
14.9.5 No-Transform Directive .........................107
14.9.6 Cache Control Extensions .......................108
14.10 Connection .......................................109
14.11 Content-Base .....................................109
14.12 Content-Encoding .................................110
14.13 Content-Language .................................110
14.14 Content-Length ...................................111
14.15 Content-Location .................................112
14.16 Content-MD5 ......................................113
14.17 Content-Range ....................................114
14.18 Content-Type .....................................116
14.19 Date .............................................116
14.20 ETag .............................................117
14.21 Expires ..........................................117
14.22 From .............................................118
14.23 Host .............................................119
14.24 If-Modified-Since ................................119
14.25 If-Match .........................................121
14.26 If-None-Match ....................................122
14.27 If-Range .........................................123
14.28 If-Unmodified-Since ..............................124
14.29 Last-Modified ....................................124
14.30 Location .........................................125
14.31 Max-Forwards .....................................125
14.32 Pragma ...........................................126
14.33 Proxy-Authenticate ...............................127
14.34 Proxy-Authorization ..............................127
14.35 Public ...........................................127
14.36 Range ............................................128
14.36.1 Byte Ranges ...................................128
14.36.2 Range Retrieval Requests ......................130
14.37 Referer ..........................................131
14.38 Retry-After ......................................131
14.39 Server ...........................................132
14.40 Transfer-Encoding ................................132
14.41 Upgrade ..........................................132
14.42 User-Agent .......................................134
14.43 Vary .............................................134
14.44 Via ..............................................135
14.45 Warning ..........................................137
14.46 WWW-Authenticate .................................139
15 Security Considerations...............................139
15.1 Authentication of Clients .........................139
15.2 Offering a Choice of Authentication Schemes .......140
15.3 Abuse of Server Log Information ...................141
15.4 Transfer of Sensitive Information .................141
15.5 Attacks Based On File and Path Names ..............142
15.6 Personal Information ..............................143
15.7 Privacy Issues Connected to Accept Headers ........143
15.8 DNS Spoofing ......................................144
15.9 Location Headers and Spoofing .....................144
16 Acknowledgments.......................................144
17 References............................................146
18 Authors' Addresses....................................149
19 Appendices............................................150
19.1 Internet Media Type message/http ..................150
19.2 Internet Media Type multipart/byteranges ..........150
19.3 Tolerant Applications .............................151
19.4 Differences Between HTTP Entities and
MIME Entities...........................................152
19.4.1 Conversion to Canonical Form ...................152
19.4.2 Conversion of Date Formats .....................153
19.4.3 Introduction of Content-Encoding ...............153
19.4.4 No Content-Transfer-Encoding ...................153
19.4.5 HTTP Header Fields in Multipart Body-Parts .....153
19.4.6 Introduction of Transfer-Encoding ..............154
19.4.7 MIME-Version ...................................154
19.5 Changes from HTTP/1.0 .............................154
19.5.1 Changes to Simplify Multi-homed Web Servers and
Conserve IP Addresses .................................155
19.6 Additional Features ...............................156
19.6.1 Additional Request Methods .....................156
19.6.2 Additional Header Field Definitions ............156
19.7 Compatibility with Previous Versions ..............160
19.7.1 Compatibility with HTTP/1.0 Persistent
Connections............................................161
-- ※ 来源:.月光软件站 http://www.moon-soft.com.[FROM: 202.104.38.169]
|
|