Network Working Group T. Berners-Lee
Request for Comments: 1945 MIT/LCS
Category: Informational R. Fielding
UC Irvine
H. Frystyk
MIT/LCS
May 1996
Hypertext Transfer Protocol -- HTTP/1.0
关于下段备忘(Status of This Memo)
本段文字为Internet团体提供信息,并没有以任何方式指定Internet标准。本段文字没有分发限制。
IESG提示(IESG Note):
IESG已在关注此协议,并期待该文档能尽快被标准跟踪文档所替代。
摘要(Abstract)
HTTP(Hypertext Transfer Protocol)是应用级协议,它适应了分布式超媒体协作系统对灵活性及速度的要求。它是一个一般的、无状态的、基于对象的协议,通过对其请求方法(request methods)进行扩展,可以被用于多种用途,比如命名服务器(name server)及分布式对象管理系统。HTTP的一个特性是其数据表现类型允许系统的构建不再依赖于要传输的数据。
HTTP自从1990年就在WWW上被广泛使用。该规范反映了“HTTP/1.0”的普通用法。
目录(Table of Contents)
1. 介绍(Introduction )............................................………………………….. 4
1.1 目的(Purpose )............................................. .................…………… 4
1.2 术语(Terminology ).......................................... .................………… 4
1.3 概述(Overall Operation) ................................. .................…………. 6
1.4 HTTP 和 MIME ...................................... .................…………………. 8
2. 标志转换及通用语法(Notational Conventions and Generic Grammar )...... 8
2.1 补充反馈方式(Augmented BNF) ............................. .................…… 8
2.2 基本规则(Basic Rules) ................... .......... .......... .......... ................... 10
3. 协议参数(Protocol Parameters ).................................... .......... .......... .......... 12
3.1 HTTP 版本 ......................................... .......... .......... .......... .......... .......... 12
3.2 统一资源标识(Uniform Resource Identifiers )...................... ............. 14
3.2.1 一般语法(General Syntax )............................... .......... .......... 14
3.2.2 http URL ..................................... .......... .......... .......... .......... ....... 15
Berners-Lee, et al Informational [Page 1]
3.3 Date/Time 格式 .................................... .......... .......... .......... .......... .......... 15
3.4 字符集(Character Sets )..................................... .......... .......... .......... ... 17
3.5 内容译码(Content Codings )...................................... .......... .......... ...... 18
3.6 介质类型(Media Types )......................................... .......... .......... ......... 19
3.6.1 标准及文本缺省(Canonicalization and Text Defaults )............ 19
3.6.2 多部分类型(Multipart Types ).............................. .......... ......... 20
3.7 产品标识(Product Tokens )....................................... .... .... .... .... .... .... 20
4. HTTP消息(HTTP Message ).................................... .......... .......... .......... ....... 21
4.1 消息类型 ....................................... .......... .......... .......... .......... .......... ....... 21
4.2 消息标题...................................... .......... .......... .......... .......... .......... ......... 22
4.3 标题结构(General Header Fields )............................ .......... .......... ........ 23
5. 请求命令(Request )................................................. .......... .......... .......... ......... 23
5.1 请求队列(Request-Line ).................. .......... ................................. ......... 23
5.1.1 方法....................................... .......... .......... .......... .......... .......... .... 24
5.1.2 请求标识(Request-URI ).................................. .......... .......... .. 24
5.2 请求头结构(Request Header Fields )............................... .......... .......... 25
6. 回应(Response )................................................. .......... .......... .......... .......... ... 25
6.1 状态队列(Status-Line )....................................... .......... .......... ........….. 26
6.1.1 状态码及解释(Status Code and Reason Phrase ).............. ........ 26
6.2 回应头结构(Response Header Fields )............................ .......... .......... 28
7. 实体(Entity )................................................. .......... .......... .......... .......... ........ 28
7.1 实体头结构(Entity Header Fields )................................ .......... .......... .. 29
7.2 实体结构体(Entity Body )......................................... .......... .......... ....... 29
7.2.1 类型(Type )........................................ .......... .......... .......... ....... 29
7.2.2 长度(Length )...................................... .......... .......... .......... ...... 30
8. 方法定义(Method Definitions )..................................... .......... .......... .......... . 30
8.1 GET ................................................. .......... .......... .......... .......... .......... ..... 31
8.2 HEAD ................................................. .......... .......... .......... .......... .......... 31
8.3 POST ................................................ .......... .......... .......... .......... .......... .... 31
9. 状态码定义(Status Code Definitions ).................................. .......... .......... .... 32
9.1 消息1xx(Informational) .............................. .......... .......... .......... .......... 32
9.2 成功2xx(Successful) .................................... .......... .......... .......... ....... 32
9.3 重定向3xx(Redirection)................................. .......... .......... .......... .... 34
9.4 客户端错误4xx(Client Error) ................................... .......... .......... .. 35
9.5 服务端错误5xx(Server Error ).................................... .......... .......... .... 37
10. 头结构定义(Header Field Definitions )............................... .......... .......... ...... 37
10.1 允许(Allow )............................................ .......... .......... .......... .......... 38
10.2 授权(Authorization )...................................... .......... .......... .......... ...... 38
10.3 内容编码(Content-Encoding ).................................. .......... .......... ..... 39
10.4 内容长度(Content-Length ).................................... .......... .......... ....... 39
10.5 内容类型(Content-Type ).................................... .......... .......... ........... 40
10.6 日期(Date ).............................................. .......... .......... .......... .......... 40
10.7 过期(Expires )............................................ .......... .......... .......... .......... 41
10.88 来自(From )............................................... .......... .......... .......... ....... 42
Berners-Lee, et al Informational [Page 2]
10.9 从何时更改(If-Modified-Since )................................. .......... ......... .... 42
10.10 最近更改(Last-Modified )...................................... .......... .......... ........ 43
10.11 位置(Location )........................................ .......... .......... .......... ........... 44
10.12 注解(Pragma )........................................... .......... .......... .......... .......... 44
10.13 提交方(Referer ).......................................... .......... .......... .......... ........ 44
10.14 服务器(Server )........................................... .......... .......... .......... ........ 45
10.15 用户代理(User-Agent )...................................... .......... .......... .......... 46
10.16 WWW授权(WWW-Authenticate )................................. .......... .......... 46
11. 访问授权(Access Authentication ).................................. .......... .......... .......... 47
11.1 基本授权计划(Basic Authentication Scheme )...................... .......... .. 48
12. 安全考虑(Security Considerations ).................................. .......... .......... ........ 49
12.1 客户端授权(Authentication of Clients )......................... .......... .......... 49
12.2 安全方法(Safe Methods )..................................... .......... .......... .......... 49
12.3 服务器日志信息的弊端(Abuse of Server Log Information )............... 50
12.4 敏感信息传递(Transfer of Sensitive Information )................. .......... .. 50
12.5 基于文件名和路径名的攻击(Attacks Based On File and Path Names).. 51
13. 感谢(Acknowledgments )..................................... .......... .......... .......... .......... 51
14. 参考(References )......................................... .......... .......... .......... .......... ..... 52
15. 作者地址(Authors' Addresses )..................................... .......... .......... .......... 54
附录A. Internet 介质类型消息/http .............. .......... .......... .......... .......... .......... 55
附录B. 容错应用(Tolerant Applications )....................... .......... .......... .......... 55
附录C. MIME相关........................ .......... .......... .......... .......... .......... .......... ....... 56
C.1 转换为规范形式(Conversion to Canonical Form )...................... ....... 56
C.2 转换日期格式(Conversion of Date Formats )....................... ............ 57
C.3 内容编码介绍(Introduction of Content-Encoding ).................... .......... 57
C.4 无内容传输的编码(No Content-Transfer-Encoding )........................ ... 57
C.5 多个主体的HTTP标题域(HTTP Header Fields in Multipart Body-Parts). 57
附录D. 额外特性(Additional Features )............................ .......... .......... .......... 57
D.1 附加请求方法(Additional Request Methods )........................ ........... 58
D.1.1 PUT ....................................... .......... .......... .......... .......... ........... 58
D.1.2 DELETE ..................................... .......... .......... .......... .......... ....... 58
D.1.3 LINK ...................................... .......... .......... .......... .......... ........... 58
D.1.4 UNLINK .................................... .......... .......... .......... .......... ........ 58
D.2 附加头结构定义(Additional Header Field Definitions )............. ........ 58
D.2.1 Accept ................................... .......... .......... .......... .......... ............ 58
D.2.2 Accept-Charset ............................ .......... .......... .......... .......... ...... 59
D.2.3 Accept-Encoding ........................... .......... .......... .......... .......... .. 59
D.2.4 Accept-Language ........................... .......... .......... .......... ........... 59
D.2.5 Content-Language .......................... .......... .......... .......... ........... 59
D.2.6 Link ...................................... .......... .......... .......... .......... ........... 59
D.2.7 MIME-Version ............................. .......... .......... .......... .......... ...... 59
D.2.8 Retry-After ............................... .......... .......... .......... .......... .......... 60
D.2.9 Title .................................... .......... .......... .......... .......... .............. 60
D.2.10 URI ........................................ .......... .......... .......... .......... .......... 60
Berners-Lee, et al Informational [Page 3]