annotate docs/rfcs/rfc2068.txt @ 939:7b170a0ed7f4

Updated Occitan translation
author ymarcheg
date Mon, 31 Dec 2007 22:01:43 +0000
parents e60a6ec4aa85
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
497
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7 Network Working Group R. Fielding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8 Request for Comments: 2068 UC Irvine
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9 Category: Standards Track J. Gettys
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
10 J. Mogul
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
11 DEC
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
12 H. Frystyk
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
13 T. Berners-Lee
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
14 MIT/LCS
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
15 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
16
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
17
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
18 Hypertext Transfer Protocol -- HTTP/1.1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
19
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
20 Status of this Memo
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
21
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
22 This document specifies an Internet standards track protocol for the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
23 Internet community, and requests discussion and suggestions for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
24 improvements. Please refer to the current edition of the "Internet
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
25 Official Protocol Standards" (STD 1) for the standardization state
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
26 and status of this protocol. Distribution of this memo is unlimited.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
27
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
28 Abstract
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
29
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
30 The Hypertext Transfer Protocol (HTTP) is an application-level
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
31 protocol for distributed, collaborative, hypermedia information
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
32 systems. It is a generic, stateless, object-oriented protocol which
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
33 can be used for many tasks, such as name servers and distributed
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
34 object management systems, through extension of its request methods.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
35 A feature of HTTP is the typing and negotiation of data
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
36 representation, allowing systems to be built independently of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
37 data being transferred.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
38
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
39 HTTP has been in use by the World-Wide Web global information
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
40 initiative since 1990. This specification defines the protocol
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
41 referred to as "HTTP/1.1".
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
42
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
43 Table of Contents
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
44
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
45 1 Introduction.............................................7
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
46 1.1 Purpose ..............................................7
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
47 1.2 Requirements .........................................7
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
48 1.3 Terminology ..........................................8
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
49 1.4 Overall Operation ...................................11
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
50 2 Notational Conventions and Generic Grammar..............13
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
51 2.1 Augmented BNF .......................................13
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
52 2.2 Basic Rules .........................................15
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
53 3 Protocol Parameters.....................................17
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
54 3.1 HTTP Version ........................................17
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
55
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
56
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
57
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
58 Fielding, et. al. Standards Track [Page 1]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
59
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
60 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
61
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
62
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
63 3.2 Uniform Resource Identifiers ........................18
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
64 3.2.1 General Syntax ...................................18
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
65 3.2.2 http URL .........................................19
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
66 3.2.3 URI Comparison ...................................20
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
67 3.3 Date/Time Formats ...................................21
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
68 3.3.1 Full Date ........................................21
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
69 3.3.2 Delta Seconds ....................................22
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
70 3.4 Character Sets ......................................22
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
71 3.5 Content Codings .....................................23
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
72 3.6 Transfer Codings ....................................24
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
73 3.7 Media Types .........................................25
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
74 3.7.1 Canonicalization and Text Defaults ...............26
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
75 3.7.2 Multipart Types ..................................27
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
76 3.8 Product Tokens ......................................28
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
77 3.9 Quality Values ......................................28
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
78 3.10 Language Tags ......................................28
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
79 3.11 Entity Tags ........................................29
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
80 3.12 Range Units ........................................30
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
81 4 HTTP Message............................................30
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
82 4.1 Message Types .......................................30
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
83 4.2 Message Headers .....................................31
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
84 4.3 Message Body ........................................32
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
85 4.4 Message Length ......................................32
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
86 4.5 General Header Fields ...............................34
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
87 5 Request.................................................34
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
88 5.1 Request-Line ........................................34
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
89 5.1.1 Method ...........................................35
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
90 5.1.2 Request-URI ......................................35
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
91 5.2 The Resource Identified by a Request ................37
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
92 5.3 Request Header Fields ...............................37
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
93 6 Response................................................38
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
94 6.1 Status-Line .........................................38
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
95 6.1.1 Status Code and Reason Phrase ....................39
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
96 6.2 Response Header Fields ..............................41
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
97 7 Entity..................................................41
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
98 7.1 Entity Header Fields ................................41
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
99 7.2 Entity Body .........................................42
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
100 7.2.1 Type .............................................42
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
101 7.2.2 Length ...........................................43
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
102 8 Connections.............................................43
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
103 8.1 Persistent Connections ..............................43
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
104 8.1.1 Purpose ..........................................43
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
105 8.1.2 Overall Operation ................................44
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
106 8.1.3 Proxy Servers ....................................45
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
107 8.1.4 Practical Considerations .........................45
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
108 8.2 Message Transmission Requirements ...................46
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
109 9 Method Definitions......................................48
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
110 9.1 Safe and Idempotent Methods .........................48
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
111
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
112
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
113
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
114 Fielding, et. al. Standards Track [Page 2]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
115
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
116 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
117
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
118
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
119 9.1.1 Safe Methods .....................................48
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
120 9.1.2 Idempotent Methods ...............................49
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
121 9.2 OPTIONS .............................................49
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
122 9.3 GET .................................................50
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
123 9.4 HEAD ................................................50
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
124 9.5 POST ................................................51
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
125 9.6 PUT .................................................52
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
126 9.7 DELETE ..............................................53
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
127 9.8 TRACE ...............................................53
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
128 10 Status Code Definitions................................53
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
129 10.1 Informational 1xx ..................................54
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
130 10.1.1 100 Continue ....................................54
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
131 10.1.2 101 Switching Protocols .........................54
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
132 10.2 Successful 2xx .....................................54
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
133 10.2.1 200 OK ..........................................54
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
134 10.2.2 201 Created .....................................55
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
135 10.2.3 202 Accepted ....................................55
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
136 10.2.4 203 Non-Authoritative Information ...............55
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
137 10.2.5 204 No Content ..................................55
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
138 10.2.6 205 Reset Content ...............................56
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
139 10.2.7 206 Partial Content .............................56
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
140 10.3 Redirection 3xx ....................................56
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
141 10.3.1 300 Multiple Choices ............................57
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
142 10.3.2 301 Moved Permanently ...........................57
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
143 10.3.3 302 Moved Temporarily ...........................58
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
144 10.3.4 303 See Other ...................................58
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
145 10.3.5 304 Not Modified ................................58
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
146 10.3.6 305 Use Proxy ...................................59
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
147 10.4 Client Error 4xx ...................................59
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
148 10.4.1 400 Bad Request .................................60
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
149 10.4.2 401 Unauthorized ................................60
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
150 10.4.3 402 Payment Required ............................60
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
151 10.4.4 403 Forbidden ...................................60
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
152 10.4.5 404 Not Found ...................................60
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
153 10.4.6 405 Method Not Allowed ..........................61
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
154 10.4.7 406 Not Acceptable ..............................61
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
155 10.4.8 407 Proxy Authentication Required ...............61
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
156 10.4.9 408 Request Timeout .............................62
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
157 10.4.10 409 Conflict ...................................62
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
158 10.4.11 410 Gone .......................................62
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
159 10.4.12 411 Length Required ............................63
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
160 10.4.13 412 Precondition Failed ........................63
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
161 10.4.14 413 Request Entity Too Large ...................63
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
162 10.4.15 414 Request-URI Too Long .......................63
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
163 10.4.16 415 Unsupported Media Type .....................63
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
164 10.5 Server Error 5xx ...................................64
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
165 10.5.1 500 Internal Server Error .......................64
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
166 10.5.2 501 Not Implemented .............................64
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
167
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
168
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
169
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
170 Fielding, et. al. Standards Track [Page 3]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
171
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
172 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
173
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
174
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
175 10.5.3 502 Bad Gateway .................................64
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
176 10.5.4 503 Service Unavailable .........................64
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
177 10.5.5 504 Gateway Timeout .............................64
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
178 10.5.6 505 HTTP Version Not Supported ..................65
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
179 11 Access Authentication..................................65
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
180 11.1 Basic Authentication Scheme ........................66
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
181 11.2 Digest Authentication Scheme .......................67
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
182 12 Content Negotiation....................................67
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
183 12.1 Server-driven Negotiation ..........................68
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
184 12.2 Agent-driven Negotiation ...........................69
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
185 12.3 Transparent Negotiation ............................70
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
186 13 Caching in HTTP........................................70
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
187 13.1.1 Cache Correctness ...............................72
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
188 13.1.2 Warnings ........................................73
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
189 13.1.3 Cache-control Mechanisms ........................74
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
190 13.1.4 Explicit User Agent Warnings ....................74
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
191 13.1.5 Exceptions to the Rules and Warnings ............75
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
192 13.1.6 Client-controlled Behavior ......................75
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
193 13.2 Expiration Model ...................................75
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
194 13.2.1 Server-Specified Expiration .....................75
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
195 13.2.2 Heuristic Expiration ............................76
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
196 13.2.3 Age Calculations ................................77
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
197 13.2.4 Expiration Calculations .........................79
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
198 13.2.5 Disambiguating Expiration Values ................80
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
199 13.2.6 Disambiguating Multiple Responses ...............80
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
200 13.3 Validation Model ...................................81
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
201 13.3.1 Last-modified Dates .............................82
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
202 13.3.2 Entity Tag Cache Validators .....................82
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
203 13.3.3 Weak and Strong Validators ......................82
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
204 13.3.4 Rules for When to Use Entity Tags and Last-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
205 modified Dates..........................................85
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
206 13.3.5 Non-validating Conditionals .....................86
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
207 13.4 Response Cachability ...............................86
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
208 13.5 Constructing Responses From Caches .................87
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
209 13.5.1 End-to-end and Hop-by-hop Headers ...............88
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
210 13.5.2 Non-modifiable Headers ..........................88
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
211 13.5.3 Combining Headers ...............................89
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
212 13.5.4 Combining Byte Ranges ...........................90
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
213 13.6 Caching Negotiated Responses .......................90
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
214 13.7 Shared and Non-Shared Caches .......................91
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
215 13.8 Errors or Incomplete Response Cache Behavior .......91
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
216 13.9 Side Effects of GET and HEAD .......................92
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
217 13.10 Invalidation After Updates or Deletions ...........92
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
218 13.11 Write-Through Mandatory ...........................93
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
219 13.12 Cache Replacement .................................93
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
220 13.13 History Lists .....................................93
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
221 14 Header Field Definitions...............................94
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
222 14.1 Accept .............................................95
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
223
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
224
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
225
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
226 Fielding, et. al. Standards Track [Page 4]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
227
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
228 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
229
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
230
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
231 14.2 Accept-Charset .....................................97
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
232 14.3 Accept-Encoding ....................................97
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
233 14.4 Accept-Language ....................................98
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
234 14.5 Accept-Ranges ......................................99
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
235 14.6 Age ................................................99
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
236 14.7 Allow .............................................100
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
237 14.8 Authorization .....................................100
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
238 14.9 Cache-Control .....................................101
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
239 14.9.1 What is Cachable ...............................103
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
240 14.9.2 What May be Stored by Caches ...................103
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
241 14.9.3 Modifications of the Basic Expiration Mechanism 104
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
242 14.9.4 Cache Revalidation and Reload Controls .........105
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
243 14.9.5 No-Transform Directive .........................107
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
244 14.9.6 Cache Control Extensions .......................108
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
245 14.10 Connection .......................................109
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
246 14.11 Content-Base .....................................109
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
247 14.12 Content-Encoding .................................110
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
248 14.13 Content-Language .................................110
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
249 14.14 Content-Length ...................................111
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
250 14.15 Content-Location .................................112
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
251 14.16 Content-MD5 ......................................113
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
252 14.17 Content-Range ....................................114
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
253 14.18 Content-Type .....................................116
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
254 14.19 Date .............................................116
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
255 14.20 ETag .............................................117
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
256 14.21 Expires ..........................................117
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
257 14.22 From .............................................118
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
258 14.23 Host .............................................119
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
259 14.24 If-Modified-Since ................................119
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
260 14.25 If-Match .........................................121
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
261 14.26 If-None-Match ....................................122
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
262 14.27 If-Range .........................................123
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
263 14.28 If-Unmodified-Since ..............................124
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
264 14.29 Last-Modified ....................................124
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
265 14.30 Location .........................................125
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
266 14.31 Max-Forwards .....................................125
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
267 14.32 Pragma ...........................................126
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
268 14.33 Proxy-Authenticate ...............................127
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
269 14.34 Proxy-Authorization ..............................127
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
270 14.35 Public ...........................................127
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
271 14.36 Range ............................................128
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
272 14.36.1 Byte Ranges ...................................128
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
273 14.36.2 Range Retrieval Requests ......................130
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
274 14.37 Referer ..........................................131
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
275 14.38 Retry-After ......................................131
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
276 14.39 Server ...........................................132
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
277 14.40 Transfer-Encoding ................................132
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
278 14.41 Upgrade ..........................................132
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
279
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
280
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
281
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
282 Fielding, et. al. Standards Track [Page 5]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
283
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
284 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
285
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
286
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
287 14.42 User-Agent .......................................134
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
288 14.43 Vary .............................................134
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
289 14.44 Via ..............................................135
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
290 14.45 Warning ..........................................137
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
291 14.46 WWW-Authenticate .................................139
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
292 15 Security Considerations...............................139
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
293 15.1 Authentication of Clients .........................139
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
294 15.2 Offering a Choice of Authentication Schemes .......140
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
295 15.3 Abuse of Server Log Information ...................141
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
296 15.4 Transfer of Sensitive Information .................141
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
297 15.5 Attacks Based On File and Path Names ..............142
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
298 15.6 Personal Information ..............................143
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
299 15.7 Privacy Issues Connected to Accept Headers ........143
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
300 15.8 DNS Spoofing ......................................144
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
301 15.9 Location Headers and Spoofing .....................144
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
302 16 Acknowledgments.......................................144
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
303 17 References............................................146
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
304 18 Authors' Addresses....................................149
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
305 19 Appendices............................................150
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
306 19.1 Internet Media Type message/http ..................150
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
307 19.2 Internet Media Type multipart/byteranges ..........150
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
308 19.3 Tolerant Applications .............................151
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
309 19.4 Differences Between HTTP Entities and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
310 MIME Entities...........................................152
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
311 19.4.1 Conversion to Canonical Form ...................152
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
312 19.4.2 Conversion of Date Formats .....................153
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
313 19.4.3 Introduction of Content-Encoding ...............153
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
314 19.4.4 No Content-Transfer-Encoding ...................153
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
315 19.4.5 HTTP Header Fields in Multipart Body-Parts .....153
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
316 19.4.6 Introduction of Transfer-Encoding ..............154
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
317 19.4.7 MIME-Version ...................................154
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
318 19.5 Changes from HTTP/1.0 .............................154
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
319 19.5.1 Changes to Simplify Multi-homed Web Servers and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
320 Conserve IP Addresses .................................155
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
321 19.6 Additional Features ...............................156
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
322 19.6.1 Additional Request Methods .....................156
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
323 19.6.2 Additional Header Field Definitions ............156
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
324 19.7 Compatibility with Previous Versions ..............160
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
325 19.7.1 Compatibility with HTTP/1.0 Persistent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
326 Connections............................................161
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
327
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
328
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
329
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
330
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
331
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
332
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
333
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
334
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
335
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
336
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
337
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
338 Fielding, et. al. Standards Track [Page 6]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
339
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
340 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
341
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
342
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
343 1 Introduction
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
344
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
345 1.1 Purpose
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
346
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
347 The Hypertext Transfer Protocol (HTTP) is an application-level
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
348 protocol for distributed, collaborative, hypermedia information
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
349 systems. HTTP has been in use by the World-Wide Web global
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
350 information initiative since 1990. The first version of HTTP,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
351 referred to as HTTP/0.9, was a simple protocol for raw data transfer
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
352 across the Internet. HTTP/1.0, as defined by RFC 1945 [6], improved
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
353 the protocol by allowing messages to be in the format of MIME-like
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
354 messages, containing metainformation about the data transferred and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
355 modifiers on the request/response semantics. However, HTTP/1.0 does
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
356 not sufficiently take into consideration the effects of hierarchical
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
357 proxies, caching, the need for persistent connections, and virtual
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
358 hosts. In addition, the proliferation of incompletely-implemented
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
359 applications calling themselves "HTTP/1.0" has necessitated a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
360 protocol version change in order for two communicating applications
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
361 to determine each other's true capabilities.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
362
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
363 This specification defines the protocol referred to as "HTTP/1.1".
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
364 This protocol includes more stringent requirements than HTTP/1.0 in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
365 order to ensure reliable implementation of its features.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
366
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
367 Practical information systems require more functionality than simple
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
368 retrieval, including search, front-end update, and annotation. HTTP
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
369 allows an open-ended set of methods that indicate the purpose of a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
370 request. It builds on the discipline of reference provided by the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
371 Uniform Resource Identifier (URI) [3][20], as a location (URL) [4] or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
372 name (URN) , for indicating the resource to which a method is to be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
373 applied. Messages are passed in a format similar to that used by
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
374 Internet mail as defined by the Multipurpose Internet Mail Extensions
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
375 (MIME).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
376
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
377 HTTP is also used as a generic protocol for communication between
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
378 user agents and proxies/gateways to other Internet systems, including
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
379 those supported by the SMTP [16], NNTP [13], FTP [18], Gopher [2],
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
380 and WAIS [10] protocols. In this way, HTTP allows basic hypermedia
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
381 access to resources available from diverse applications.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
382
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
383 1.2 Requirements
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
384
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
385 This specification uses the same words as RFC 1123 [8] for defining
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
386 the significance of each particular requirement. These words are:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
387
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
388 MUST
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
389 This word or the adjective "required" means that the item is an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
390 absolute requirement of the specification.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
391
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
392
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
393
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
394 Fielding, et. al. Standards Track [Page 7]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
395
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
396 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
397
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
398
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
399 SHOULD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
400 This word or the adjective "recommended" means that there may
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
401 exist valid reasons in particular circumstances to ignore this
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
402 item, but the full implications should be understood and the case
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
403 carefully weighed before choosing a different course.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
404
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
405 MAY
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
406 This word or the adjective "optional" means that this item is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
407 truly optional. One vendor may choose to include the item because
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
408 a particular marketplace requires it or because it enhances the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
409 product, for example; another vendor may omit the same item.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
410
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
411 An implementation is not compliant if it fails to satisfy one or more
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
412 of the MUST requirements for the protocols it implements. An
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
413 implementation that satisfies all the MUST and all the SHOULD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
414 requirements for its protocols is said to be "unconditionally
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
415 compliant"; one that satisfies all the MUST requirements but not all
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
416 the SHOULD requirements for its protocols is said to be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
417 "conditionally compliant."
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
418
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
419 1.3 Terminology
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
420
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
421 This specification uses a number of terms to refer to the roles
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
422 played by participants in, and objects of, the HTTP communication.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
423
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
424 connection
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
425 A transport layer virtual circuit established between two programs
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
426 for the purpose of communication.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
427
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
428 message
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
429 The basic unit of HTTP communication, consisting of a structured
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
430 sequence of octets matching the syntax defined in section 4 and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
431 transmitted via the connection.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
432
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
433 request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
434 An HTTP request message, as defined in section 5.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
435
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
436 response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
437 An HTTP response message, as defined in section 6.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
438
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
439 resource
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
440 A network data object or service that can be identified by a URI,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
441 as defined in section 3.2. Resources may be available in multiple
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
442 representations (e.g. multiple languages, data formats, size,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
443 resolutions) or vary in other ways.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
444
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
445
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
446
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
447
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
448
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
449
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
450 Fielding, et. al. Standards Track [Page 8]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
451
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
452 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
453
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
454
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
455 entity
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
456 The information transferred as the payload of a request or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
457 response. An entity consists of metainformation in the form of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
458 entity-header fields and content in the form of an entity-body, as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
459 described in section 7.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
460
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
461 representation
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
462 An entity included with a response that is subject to content
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
463 negotiation, as described in section 12. There may exist multiple
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
464 representations associated with a particular response status.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
465
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
466 content negotiation
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
467 The mechanism for selecting the appropriate representation when
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
468 servicing a request, as described in section 12. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
469 representation of entities in any response can be negotiated
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
470 (including error responses).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
471
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
472 variant
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
473 A resource may have one, or more than one, representation(s)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
474 associated with it at any given instant. Each of these
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
475 representations is termed a `variant.' Use of the term `variant'
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
476 does not necessarily imply that the resource is subject to content
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
477 negotiation.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
478
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
479 client
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
480 A program that establishes connections for the purpose of sending
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
481 requests.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
482
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
483 user agent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
484 The client which initiates a request. These are often browsers,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
485 editors, spiders (web-traversing robots), or other end user tools.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
486
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
487 server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
488 An application program that accepts connections in order to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
489 service requests by sending back responses. Any given program may
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
490 be capable of being both a client and a server; our use of these
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
491 terms refers only to the role being performed by the program for a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
492 particular connection, rather than to the program's capabilities
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
493 in general. Likewise, any server may act as an origin server,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
494 proxy, gateway, or tunnel, switching behavior based on the nature
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
495 of each request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
496
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
497 origin server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
498 The server on which a given resource resides or is to be created.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
499
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
500
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
501
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
502
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
503
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
504
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
505
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
506 Fielding, et. al. Standards Track [Page 9]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
507
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
508 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
509
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
510
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
511 proxy
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
512 An intermediary program which acts as both a server and a client
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
513 for the purpose of making requests on behalf of other clients.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
514 Requests are serviced internally or by passing them on, with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
515 possible translation, to other servers. A proxy must implement
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
516 both the client and server requirements of this specification.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
517
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
518 gateway
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
519 A server which acts as an intermediary for some other server.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
520 Unlike a proxy, a gateway receives requests as if it were the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
521 origin server for the requested resource; the requesting client
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
522 may not be aware that it is communicating with a gateway.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
523
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
524 tunnel
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
525 An intermediary program which is acting as a blind relay between
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
526 two connections. Once active, a tunnel is not considered a party
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
527 to the HTTP communication, though the tunnel may have been
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
528 initiated by an HTTP request. The tunnel ceases to exist when both
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
529 ends of the relayed connections are closed.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
530
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
531 cache
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
532 A program's local store of response messages and the subsystem
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
533 that controls its message storage, retrieval, and deletion. A
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
534 cache stores cachable responses in order to reduce the response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
535 time and network bandwidth consumption on future, equivalent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
536 requests. Any client or server may include a cache, though a cache
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
537 cannot be used by a server that is acting as a tunnel.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
538
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
539 cachable
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
540 A response is cachable if a cache is allowed to store a copy of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
541 the response message for use in answering subsequent requests. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
542 rules for determining the cachability of HTTP responses are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
543 defined in section 13. Even if a resource is cachable, there may
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
544 be additional constraints on whether a cache can use the cached
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
545 copy for a particular request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
546
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
547 first-hand
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
548 A response is first-hand if it comes directly and without
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
549 unnecessary delay from the origin server, perhaps via one or more
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
550 proxies. A response is also first-hand if its validity has just
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
551 been checked directly with the origin server.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
552
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
553 explicit expiration time
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
554 The time at which the origin server intends that an entity should
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
555 no longer be returned by a cache without further validation.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
556
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
557
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
558
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
559
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
560
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
561
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
562 Fielding, et. al. Standards Track [Page 10]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
563
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
564 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
565
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
566
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
567 heuristic expiration time
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
568 An expiration time assigned by a cache when no explicit expiration
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
569 time is available.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
570
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
571 age
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
572 The age of a response is the time since it was sent by, or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
573 successfully validated with, the origin server.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
574
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
575 freshness lifetime
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
576 The length of time between the generation of a response and its
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
577 expiration time.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
578
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
579 fresh
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
580 A response is fresh if its age has not yet exceeded its freshness
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
581 lifetime.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
582
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
583 stale
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
584 A response is stale if its age has passed its freshness lifetime.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
585
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
586 semantically transparent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
587 A cache behaves in a "semantically transparent" manner, with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
588 respect to a particular response, when its use affects neither the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
589 requesting client nor the origin server, except to improve
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
590 performance. When a cache is semantically transparent, the client
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
591 receives exactly the same response (except for hop-by-hop headers)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
592 that it would have received had its request been handled directly
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
593 by the origin server.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
594
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
595 validator
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
596 A protocol element (e.g., an entity tag or a Last-Modified time)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
597 that is used to find out whether a cache entry is an equivalent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
598 copy of an entity.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
599
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
600 1.4 Overall Operation
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
601
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
602 The HTTP protocol is a request/response protocol. A client sends a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
603 request to the server in the form of a request method, URI, and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
604 protocol version, followed by a MIME-like message containing request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
605 modifiers, client information, and possible body content over a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
606 connection with a server. The server responds with a status line,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
607 including the message's protocol version and a success or error code,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
608 followed by a MIME-like message containing server information, entity
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
609 metainformation, and possible entity-body content. The relationship
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
610 between HTTP and MIME is described in appendix 19.4.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
611
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
612
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
613
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
614
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
615
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
616
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
617
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
618 Fielding, et. al. Standards Track [Page 11]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
619
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
620 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
621
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
622
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
623 Most HTTP communication is initiated by a user agent and consists of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
624 a request to be applied to a resource on some origin server. In the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
625 simplest case, this may be accomplished via a single connection (v)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
626 between the user agent (UA) and the origin server (O).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
627
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
628 request chain ------------------------>
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
629 UA -------------------v------------------- O
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
630 <----------------------- response chain
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
631
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
632 A more complicated situation occurs when one or more intermediaries
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
633 are present in the request/response chain. There are three common
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
634 forms of intermediary: proxy, gateway, and tunnel. A proxy is a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
635 forwarding agent, receiving requests for a URI in its absolute form,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
636 rewriting all or part of the message, and forwarding the reformatted
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
637 request toward the server identified by the URI. A gateway is a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
638 receiving agent, acting as a layer above some other server(s) and, if
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
639 necessary, translating the requests to the underlying server's
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
640 protocol. A tunnel acts as a relay point between two connections
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
641 without changing the messages; tunnels are used when the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
642 communication needs to pass through an intermediary (such as a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
643 firewall) even when the intermediary cannot understand the contents
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
644 of the messages.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
645
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
646 request chain -------------------------------------->
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
647 UA -----v----- A -----v----- B -----v----- C -----v----- O
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
648 <------------------------------------- response chain
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
649
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
650 The figure above shows three intermediaries (A, B, and C) between the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
651 user agent and origin server. A request or response message that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
652 travels the whole chain will pass through four separate connections.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
653 This distinction is important because some HTTP communication options
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
654 may apply only to the connection with the nearest, non-tunnel
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
655 neighbor, only to the end-points of the chain, or to all connections
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
656 along the chain. Although the diagram is linear, each participant
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
657 may be engaged in multiple, simultaneous communications. For example,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
658 B may be receiving requests from many clients other than A, and/or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
659 forwarding requests to servers other than C, at the same time that it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
660 is handling A's request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
661
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
662 Any party to the communication which is not acting as a tunnel may
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
663 employ an internal cache for handling requests. The effect of a cache
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
664 is that the request/response chain is shortened if one of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
665 participants along the chain has a cached response applicable to that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
666 request. The following illustrates the resulting chain if B has a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
667 cached copy of an earlier response from O (via C) for a request which
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
668 has not been cached by UA or A.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
669
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
670
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
671
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
672
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
673
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
674 Fielding, et. al. Standards Track [Page 12]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
675
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
676 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
677
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
678
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
679 request chain ---------->
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
680 UA -----v----- A -----v----- B - - - - - - C - - - - - - O
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
681 <--------- response chain
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
682
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
683 Not all responses are usefully cachable, and some requests may
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
684 contain modifiers which place special requirements on cache behavior.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
685 HTTP requirements for cache behavior and cachable responses are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
686 defined in section 13.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
687
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
688 In fact, there are a wide variety of architectures and configurations
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
689 of caches and proxies currently being experimented with or deployed
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
690 across the World Wide Web; these systems include national hierarchies
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
691 of proxy caches to save transoceanic bandwidth, systems that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
692 broadcast or multicast cache entries, organizations that distribute
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
693 subsets of cached data via CD-ROM, and so on. HTTP systems are used
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
694 in corporate intranets over high-bandwidth links, and for access via
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
695 PDAs with low-power radio links and intermittent connectivity. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
696 goal of HTTP/1.1 is to support the wide diversity of configurations
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
697 already deployed while introducing protocol constructs that meet the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
698 needs of those who build web applications that require high
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
699 reliability and, failing that, at least reliable indications of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
700 failure.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
701
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
702 HTTP communication usually takes place over TCP/IP connections. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
703 default port is TCP 80, but other ports can be used. This does not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
704 preclude HTTP from being implemented on top of any other protocol on
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
705 the Internet, or on other networks. HTTP only presumes a reliable
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
706 transport; any protocol that provides such guarantees can be used;
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
707 the mapping of the HTTP/1.1 request and response structures onto the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
708 transport data units of the protocol in question is outside the scope
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
709 of this specification.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
710
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
711 In HTTP/1.0, most implementations used a new connection for each
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
712 request/response exchange. In HTTP/1.1, a connection may be used for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
713 one or more request/response exchanges, although connections may be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
714 closed for a variety of reasons (see section 8.1).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
715
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
716 2 Notational Conventions and Generic Grammar
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
717
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
718 2.1 Augmented BNF
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
719
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
720 All of the mechanisms specified in this document are described in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
721 both prose and an augmented Backus-Naur Form (BNF) similar to that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
722 used by RFC 822 [9]. Implementers will need to be familiar with the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
723 notation in order to understand this specification. The augmented BNF
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
724 includes the following constructs:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
725
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
726
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
727
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
728
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
729
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
730 Fielding, et. al. Standards Track [Page 13]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
731
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
732 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
733
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
734
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
735 name = definition
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
736 The name of a rule is simply the name itself (without any enclosing
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
737 "<" and ">") and is separated from its definition by the equal "="
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
738 character. Whitespace is only significant in that indentation of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
739 continuation lines is used to indicate a rule definition that spans
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
740 more than one line. Certain basic rules are in uppercase, such as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
741 SP, LWS, HT, CRLF, DIGIT, ALPHA, etc. Angle brackets are used
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
742 within definitions whenever their presence will facilitate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
743 discerning the use of rule names.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
744
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
745 "literal"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
746 Quotation marks surround literal text. Unless stated otherwise, the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
747 text is case-insensitive.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
748
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
749 rule1 | rule2
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
750 Elements separated by a bar ("|") are alternatives, e.g., "yes |
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
751 no" will accept yes or no.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
752
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
753 (rule1 rule2)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
754 Elements enclosed in parentheses are treated as a single element.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
755 Thus, "(elem (foo | bar) elem)" allows the token sequences "elem
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
756 foo elem" and "elem bar elem".
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
757
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
758 *rule
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
759 The character "*" preceding an element indicates repetition. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
760 full form is "<n>*<m>element" indicating at least <n> and at most
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
761 <m> occurrences of element. Default values are 0 and infinity so
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
762 that "*(element)" allows any number, including zero; "1*element"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
763 requires at least one; and "1*2element" allows one or two.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
764
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
765 [rule]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
766 Square brackets enclose optional elements; "[foo bar]" is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
767 equivalent to "*1(foo bar)".
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
768
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
769 N rule
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
770 Specific repetition: "<n>(element)" is equivalent to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
771 "<n>*<n>(element)"; that is, exactly <n> occurrences of (element).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
772 Thus 2DIGIT is a 2-digit number, and 3ALPHA is a string of three
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
773 alphabetic characters.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
774
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
775 #rule
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
776 A construct "#" is defined, similar to "*", for defining lists of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
777 elements. The full form is "<n>#<m>element " indicating at least
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
778 <n> and at most <m> elements, each separated by one or more commas
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
779 (",") and optional linear whitespace (LWS). This makes the usual
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
780 form of lists very easy; a rule such as "( *LWS element *( *LWS ","
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
781 *LWS element )) " can be shown as "1#element". Wherever this
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
782 construct is used, null elements are allowed, but do not contribute
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
783
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
784
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
785
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
786 Fielding, et. al. Standards Track [Page 14]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
787
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
788 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
789
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
790
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
791 to the count of elements present. That is, "(element), , (element)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
792 " is permitted, but counts as only two elements. Therefore, where
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
793 at least one element is required, at least one non-null element
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
794 must be present. Default values are 0 and infinity so that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
795 "#element" allows any number, including zero; "1#element" requires
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
796 at least one; and "1#2element" allows one or two.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
797
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
798 ; comment
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
799 A semi-colon, set off some distance to the right of rule text,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
800 starts a comment that continues to the end of line. This is a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
801 simple way of including useful notes in parallel with the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
802 specifications.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
803
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
804 implied *LWS
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
805 The grammar described by this specification is word-based. Except
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
806 where noted otherwise, linear whitespace (LWS) can be included
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
807 between any two adjacent words (token or quoted-string), and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
808 between adjacent tokens and delimiters (tspecials), without
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
809 changing the interpretation of a field. At least one delimiter
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
810 (tspecials) must exist between any two tokens, since they would
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
811 otherwise be interpreted as a single token.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
812
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
813 2.2 Basic Rules
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
814
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
815 The following rules are used throughout this specification to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
816 describe basic parsing constructs. The US-ASCII coded character set
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
817 is defined by ANSI X3.4-1986 [21].
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
818
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
819 OCTET = <any 8-bit sequence of data>
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
820 CHAR = <any US-ASCII character (octets 0 - 127)>
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
821 UPALPHA = <any US-ASCII uppercase letter "A".."Z">
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
822 LOALPHA = <any US-ASCII lowercase letter "a".."z">
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
823 ALPHA = UPALPHA | LOALPHA
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
824 DIGIT = <any US-ASCII digit "0".."9">
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
825 CTL = <any US-ASCII control character
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
826 (octets 0 - 31) and DEL (127)>
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
827 CR = <US-ASCII CR, carriage return (13)>
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
828 LF = <US-ASCII LF, linefeed (10)>
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
829 SP = <US-ASCII SP, space (32)>
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
830 HT = <US-ASCII HT, horizontal-tab (9)>
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
831 <"> = <US-ASCII double-quote mark (34)>
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
832
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
833
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
834
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
835
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
836
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
837
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
838
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
839
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
840
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
841
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
842 Fielding, et. al. Standards Track [Page 15]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
843
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
844 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
845
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
846
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
847 HTTP/1.1 defines the sequence CR LF as the end-of-line marker for all
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
848 protocol elements except the entity-body (see appendix 19.3 for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
849 tolerant applications). The end-of-line marker within an entity-body
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
850 is defined by its associated media type, as described in section 3.7.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
851
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
852 CRLF = CR LF
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
853
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
854 HTTP/1.1 headers can be folded onto multiple lines if the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
855 continuation line begins with a space or horizontal tab. All linear
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
856 white space, including folding, has the same semantics as SP.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
857
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
858 LWS = [CRLF] 1*( SP | HT )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
859
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
860 The TEXT rule is only used for descriptive field contents and values
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
861 that are not intended to be interpreted by the message parser. Words
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
862 of *TEXT may contain characters from character sets other than ISO
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
863 8859-1 [22] only when encoded according to the rules of RFC 1522
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
864 [14].
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
865
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
866 TEXT = <any OCTET except CTLs,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
867 but including LWS>
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
868
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
869 Hexadecimal numeric characters are used in several protocol elements.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
870
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
871 HEX = "A" | "B" | "C" | "D" | "E" | "F"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
872 | "a" | "b" | "c" | "d" | "e" | "f" | DIGIT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
873
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
874 Many HTTP/1.1 header field values consist of words separated by LWS
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
875 or special characters. These special characters MUST be in a quoted
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
876 string to be used within a parameter value.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
877
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
878 token = 1*<any CHAR except CTLs or tspecials>
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
879
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
880 tspecials = "(" | ")" | "<" | ">" | "@"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
881 | "," | ";" | ":" | "\" | <">
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
882 | "/" | "[" | "]" | "?" | "="
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
883 | "{" | "}" | SP | HT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
884
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
885 Comments can be included in some HTTP header fields by surrounding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
886 the comment text with parentheses. Comments are only allowed in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
887 fields containing "comment" as part of their field value definition.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
888 In all other fields, parentheses are considered part of the field
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
889 value.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
890
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
891 comment = "(" *( ctext | comment ) ")"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
892 ctext = <any TEXT excluding "(" and ")">
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
893
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
894
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
895
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
896
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
897
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
898 Fielding, et. al. Standards Track [Page 16]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
899
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
900 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
901
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
902
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
903 A string of text is parsed as a single word if it is quoted using
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
904 double-quote marks.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
905
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
906 quoted-string = ( <"> *(qdtext) <"> )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
907
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
908 qdtext = <any TEXT except <">>
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
909
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
910 The backslash character ("\") may be used as a single-character quoting
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
911 mechanism only within quoted-string and comment constructs.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
912
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
913 quoted-pair = "\" CHAR
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
914
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
915 3 Protocol Parameters
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
916
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
917 3.1 HTTP Version
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
918
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
919 HTTP uses a "<major>.<minor>" numbering scheme to indicate versions
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
920 of the protocol. The protocol versioning policy is intended to allow
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
921 the sender to indicate the format of a message and its capacity for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
922 understanding further HTTP communication, rather than the features
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
923 obtained via that communication. No change is made to the version
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
924 number for the addition of message components which do not affect
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
925 communication behavior or which only add to extensible field values.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
926 The <minor> number is incremented when the changes made to the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
927 protocol add features which do not change the general message parsing
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
928 algorithm, but which may add to the message semantics and imply
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
929 additional capabilities of the sender. The <major> number is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
930 incremented when the format of a message within the protocol is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
931 changed.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
932
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
933 The version of an HTTP message is indicated by an HTTP-Version field
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
934 in the first line of the message.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
935
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
936 HTTP-Version = "HTTP" "/" 1*DIGIT "." 1*DIGIT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
937
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
938 Note that the major and minor numbers MUST be treated as separate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
939 integers and that each may be incremented higher than a single digit.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
940 Thus, HTTP/2.4 is a lower version than HTTP/2.13, which in turn is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
941 lower than HTTP/12.3. Leading zeros MUST be ignored by recipients and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
942 MUST NOT be sent.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
943
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
944 Applications sending Request or Response messages, as defined by this
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
945 specification, MUST include an HTTP-Version of "HTTP/1.1". Use of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
946 this version number indicates that the sending application is at
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
947 least conditionally compliant with this specification.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
948
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
949 The HTTP version of an application is the highest HTTP version for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
950 which the application is at least conditionally compliant.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
951
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
952
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
953
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
954 Fielding, et. al. Standards Track [Page 17]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
955
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
956 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
957
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
958
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
959 Proxy and gateway applications must be careful when forwarding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
960 messages in protocol versions different from that of the application.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
961 Since the protocol version indicates the protocol capability of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
962 sender, a proxy/gateway MUST never send a message with a version
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
963 indicator which is greater than its actual version; if a higher
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
964 version request is received, the proxy/gateway MUST either downgrade
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
965 the request version, respond with an error, or switch to tunnel
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
966 behavior. Requests with a version lower than that of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
967 proxy/gateway's version MAY be upgraded before being forwarded; the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
968 proxy/gateway's response to that request MUST be in the same major
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
969 version as the request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
970
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
971 Note: Converting between versions of HTTP may involve modification
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
972 of header fields required or forbidden by the versions involved.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
973
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
974 3.2 Uniform Resource Identifiers
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
975
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
976 URIs have been known by many names: WWW addresses, Universal Document
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
977 Identifiers, Universal Resource Identifiers , and finally the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
978 combination of Uniform Resource Locators (URL) and Names (URN). As
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
979 far as HTTP is concerned, Uniform Resource Identifiers are simply
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
980 formatted strings which identify--via name, location, or any other
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
981 characteristic--a resource.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
982
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
983 3.2.1 General Syntax
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
984
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
985 URIs in HTTP can be represented in absolute form or relative to some
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
986 known base URI, depending upon the context of their use. The two
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
987 forms are differentiated by the fact that absolute URIs always begin
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
988 with a scheme name followed by a colon.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
989
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
990 URI = ( absoluteURI | relativeURI ) [ "#" fragment ]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
991
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
992 absoluteURI = scheme ":" *( uchar | reserved )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
993
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
994 relativeURI = net_path | abs_path | rel_path
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
995
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
996 net_path = "//" net_loc [ abs_path ]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
997 abs_path = "/" rel_path
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
998 rel_path = [ path ] [ ";" params ] [ "?" query ]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
999
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1000 path = fsegment *( "/" segment )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1001 fsegment = 1*pchar
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1002 segment = *pchar
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1003
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1004 params = param *( ";" param )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1005 param = *( pchar | "/" )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1006
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1007
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1008
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1009
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1010 Fielding, et. al. Standards Track [Page 18]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1011
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1012 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1013
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1014
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1015 scheme = 1*( ALPHA | DIGIT | "+" | "-" | "." )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1016 net_loc = *( pchar | ";" | "?" )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1017
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1018 query = *( uchar | reserved )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1019 fragment = *( uchar | reserved )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1020
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1021 pchar = uchar | ":" | "@" | "&" | "=" | "+"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1022 uchar = unreserved | escape
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1023 unreserved = ALPHA | DIGIT | safe | extra | national
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1024
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1025 escape = "%" HEX HEX
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1026 reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1027 extra = "!" | "*" | "'" | "(" | ")" | ","
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1028 safe = "$" | "-" | "_" | "."
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1029 unsafe = CTL | SP | <"> | "#" | "%" | "<" | ">"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1030 national = <any OCTET excluding ALPHA, DIGIT,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1031 reserved, extra, safe, and unsafe>
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1032
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1033 For definitive information on URL syntax and semantics, see RFC 1738
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1034 [4] and RFC 1808 [11]. The BNF above includes national characters not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1035 allowed in valid URLs as specified by RFC 1738, since HTTP servers
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1036 are not restricted in the set of unreserved characters allowed to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1037 represent the rel_path part of addresses, and HTTP proxies may
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1038 receive requests for URIs not defined by RFC 1738.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1039
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1040 The HTTP protocol does not place any a priori limit on the length of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1041 a URI. Servers MUST be able to handle the URI of any resource they
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1042 serve, and SHOULD be able to handle URIs of unbounded length if they
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1043 provide GET-based forms that could generate such URIs. A server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1044 SHOULD return 414 (Request-URI Too Long) status if a URI is longer
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1045 than the server can handle (see section 10.4.15).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1046
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1047 Note: Servers should be cautious about depending on URI lengths
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1048 above 255 bytes, because some older client or proxy implementations
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1049 may not properly support these lengths.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1050
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1051 3.2.2 http URL
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1052
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1053 The "http" scheme is used to locate network resources via the HTTP
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1054 protocol. This section defines the scheme-specific syntax and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1055 semantics for http URLs.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1056
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1057
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1058
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1059
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1060
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1061
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1062
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1063
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1064
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1065
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1066 Fielding, et. al. Standards Track [Page 19]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1067
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1068 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1069
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1070
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1071 http_URL = "http:" "//" host [ ":" port ] [ abs_path ]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1072
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1073 host = <A legal Internet host domain name
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1074 or IP address (in dotted-decimal form),
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1075 as defined by Section 2.1 of RFC 1123>
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1076
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1077 port = *DIGIT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1078
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1079 If the port is empty or not given, port 80 is assumed. The semantics
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1080 are that the identified resource is located at the server listening
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1081 for TCP connections on that port of that host, and the Request-URI
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1082 for the resource is abs_path. The use of IP addresses in URL's SHOULD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1083 be avoided whenever possible (see RFC 1900 [24]). If the abs_path is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1084 not present in the URL, it MUST be given as "/" when used as a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1085 Request-URI for a resource (section 5.1.2).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1086
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1087 3.2.3 URI Comparison
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1088
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1089 When comparing two URIs to decide if they match or not, a client
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1090 SHOULD use a case-sensitive octet-by-octet comparison of the entire
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1091 URIs, with these exceptions:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1092
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1093 o A port that is empty or not given is equivalent to the default
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1094 port for that URI;
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1095
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1096 o Comparisons of host names MUST be case-insensitive;
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1097
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1098 o Comparisons of scheme names MUST be case-insensitive;
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1099
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1100 o An empty abs_path is equivalent to an abs_path of "/".
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1101
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1102 Characters other than those in the "reserved" and "unsafe" sets (see
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1103 section 3.2) are equivalent to their ""%" HEX HEX" encodings.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1104
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1105 For example, the following three URIs are equivalent:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1106
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1107 http://abc.com:80/~smith/home.html
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1108 http://ABC.com/%7Esmith/home.html
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1109 http://ABC.com:/%7esmith/home.html
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1110
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1111
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1112
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1113
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1114
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1115
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1116
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1117
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1118
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1119
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1120
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1121
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1122 Fielding, et. al. Standards Track [Page 20]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1123
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1124 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1125
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1126
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1127 3.3 Date/Time Formats
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1128
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1129 3.3.1 Full Date
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1130
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1131 HTTP applications have historically allowed three different formats
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1132 for the representation of date/time stamps:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1133
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1134 Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1135 Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1136 Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1137
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1138 The first format is preferred as an Internet standard and represents
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1139 a fixed-length subset of that defined by RFC 1123 (an update to RFC
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1140 822). The second format is in common use, but is based on the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1141 obsolete RFC 850 [12] date format and lacks a four-digit year.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1142 HTTP/1.1 clients and servers that parse the date value MUST accept
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1143 all three formats (for compatibility with HTTP/1.0), though they MUST
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1144 only generate the RFC 1123 format for representing HTTP-date values
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1145 in header fields.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1146
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1147 Note: Recipients of date values are encouraged to be robust in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1148 accepting date values that may have been sent by non-HTTP
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1149 applications, as is sometimes the case when retrieving or posting
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1150 messages via proxies/gateways to SMTP or NNTP.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1151
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1152 All HTTP date/time stamps MUST be represented in Greenwich Mean Time
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1153 (GMT), without exception. This is indicated in the first two formats
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1154 by the inclusion of "GMT" as the three-letter abbreviation for time
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1155 zone, and MUST be assumed when reading the asctime format.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1156
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1157 HTTP-date = rfc1123-date | rfc850-date | asctime-date
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1158
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1159 rfc1123-date = wkday "," SP date1 SP time SP "GMT"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1160 rfc850-date = weekday "," SP date2 SP time SP "GMT"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1161 asctime-date = wkday SP date3 SP time SP 4DIGIT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1162
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1163 date1 = 2DIGIT SP month SP 4DIGIT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1164 ; day month year (e.g., 02 Jun 1982)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1165 date2 = 2DIGIT "-" month "-" 2DIGIT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1166 ; day-month-year (e.g., 02-Jun-82)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1167 date3 = month SP ( 2DIGIT | ( SP 1DIGIT ))
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1168 ; month day (e.g., Jun 2)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1169
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1170 time = 2DIGIT ":" 2DIGIT ":" 2DIGIT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1171 ; 00:00:00 - 23:59:59
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1172
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1173 wkday = "Mon" | "Tue" | "Wed"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1174 | "Thu" | "Fri" | "Sat" | "Sun"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1175
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1176
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1177
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1178 Fielding, et. al. Standards Track [Page 21]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1179
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1180 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1181
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1182
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1183 weekday = "Monday" | "Tuesday" | "Wednesday"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1184 | "Thursday" | "Friday" | "Saturday" | "Sunday"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1185
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1186 month = "Jan" | "Feb" | "Mar" | "Apr"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1187 | "May" | "Jun" | "Jul" | "Aug"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1188 | "Sep" | "Oct" | "Nov" | "Dec"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1189
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1190 Note: HTTP requirements for the date/time stamp format apply only
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1191 to their usage within the protocol stream. Clients and servers are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1192 not required to use these formats for user presentation, request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1193 logging, etc.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1194
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1195 3.3.2 Delta Seconds
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1196
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1197 Some HTTP header fields allow a time value to be specified as an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1198 integer number of seconds, represented in decimal, after the time
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1199 that the message was received.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1200
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1201 delta-seconds = 1*DIGIT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1202
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1203 3.4 Character Sets
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1204
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1205 HTTP uses the same definition of the term "character set" as that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1206 described for MIME:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1207
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1208 The term "character set" is used in this document to refer to a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1209 method used with one or more tables to convert a sequence of octets
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1210 into a sequence of characters. Note that unconditional conversion
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1211 in the other direction is not required, in that not all characters
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1212 may be available in a given character set and a character set may
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1213 provide more than one sequence of octets to represent a particular
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1214 character. This definition is intended to allow various kinds of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1215 character encodings, from simple single-table mappings such as US-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1216 ASCII to complex table switching methods such as those that use ISO
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1217 2022's techniques. However, the definition associated with a MIME
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1218 character set name MUST fully specify the mapping to be performed
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1219 from octets to characters. In particular, use of external profiling
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1220 information to determine the exact mapping is not permitted.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1221
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1222 Note: This use of the term "character set" is more commonly
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1223 referred to as a "character encoding." However, since HTTP and MIME
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1224 share the same registry, it is important that the terminology also
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1225 be shared.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1226
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1227
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1228
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1229
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1230
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1231
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1232
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1233
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1234 Fielding, et. al. Standards Track [Page 22]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1235
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1236 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1237
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1238
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1239 HTTP character sets are identified by case-insensitive tokens. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1240 complete set of tokens is defined by the IANA Character Set registry
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1241 [19].
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1242
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1243 charset = token
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1244
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1245 Although HTTP allows an arbitrary token to be used as a charset
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1246 value, any token that has a predefined value within the IANA
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1247 Character Set registry MUST represent the character set defined by
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1248 that registry. Applications SHOULD limit their use of character sets
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1249 to those defined by the IANA registry.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1250
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1251 3.5 Content Codings
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1252
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1253 Content coding values indicate an encoding transformation that has
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1254 been or can be applied to an entity. Content codings are primarily
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1255 used to allow a document to be compressed or otherwise usefully
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1256 transformed without losing the identity of its underlying media type
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1257 and without loss of information. Frequently, the entity is stored in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1258 coded form, transmitted directly, and only decoded by the recipient.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1259
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1260 content-coding = token
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1261
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1262 All content-coding values are case-insensitive. HTTP/1.1 uses
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1263 content-coding values in the Accept-Encoding (section 14.3) and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1264 Content-Encoding (section 14.12) header fields. Although the value
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1265 describes the content-coding, what is more important is that it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1266 indicates what decoding mechanism will be required to remove the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1267 encoding.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1268
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1269 The Internet Assigned Numbers Authority (IANA) acts as a registry for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1270 content-coding value tokens. Initially, the registry contains the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1271 following tokens:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1272
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1273 gzip An encoding format produced by the file compression program "gzip"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1274 (GNU zip) as described in RFC 1952 [25]. This format is a Lempel-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1275 Ziv coding (LZ77) with a 32 bit CRC.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1276
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1277 compress
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1278 The encoding format produced by the common UNIX file compression
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1279 program "compress". This format is an adaptive Lempel-Ziv-Welch
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1280 coding (LZW).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1281
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1282
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1283
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1284
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1285
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1286
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1287
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1288
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1289
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1290 Fielding, et. al. Standards Track [Page 23]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1291
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1292 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1293
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1294
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1295 Note: Use of program names for the identification of encoding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1296 formats is not desirable and should be discouraged for future
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1297 encodings. Their use here is representative of historical practice,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1298 not good design. For compatibility with previous implementations of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1299 HTTP, applications should consider "x-gzip" and "x-compress" to be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1300 equivalent to "gzip" and "compress" respectively.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1301
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1302 deflate The "zlib" format defined in RFC 1950[31] in combination with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1303 the "deflate" compression mechanism described in RFC 1951[29].
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1304
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1305 New content-coding value tokens should be registered; to allow
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1306 interoperability between clients and servers, specifications of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1307 content coding algorithms needed to implement a new value should be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1308 publicly available and adequate for independent implementation, and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1309 conform to the purpose of content coding defined in this section.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1310
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1311 3.6 Transfer Codings
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1312
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1313 Transfer coding values are used to indicate an encoding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1314 transformation that has been, can be, or may need to be applied to an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1315 entity-body in order to ensure "safe transport" through the network.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1316 This differs from a content coding in that the transfer coding is a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1317 property of the message, not of the original entity.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1318
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1319 transfer-coding = "chunked" | transfer-extension
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1320
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1321 transfer-extension = token
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1322
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1323 All transfer-coding values are case-insensitive. HTTP/1.1 uses
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1324 transfer coding values in the Transfer-Encoding header field (section
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1325 14.40).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1326
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1327 Transfer codings are analogous to the Content-Transfer-Encoding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1328 values of MIME , which were designed to enable safe transport of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1329 binary data over a 7-bit transport service. However, safe transport
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1330 has a different focus for an 8bit-clean transfer protocol. In HTTP,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1331 the only unsafe characteristic of message-bodies is the difficulty in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1332 determining the exact body length (section 7.2.2), or the desire to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1333 encrypt data over a shared transport.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1334
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1335 The chunked encoding modifies the body of a message in order to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1336 transfer it as a series of chunks, each with its own size indicator,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1337 followed by an optional footer containing entity-header fields. This
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1338 allows dynamically-produced content to be transferred along with the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1339 information necessary for the recipient to verify that it has
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1340 received the full message.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1341
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1342
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1343
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1344
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1345
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1346 Fielding, et. al. Standards Track [Page 24]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1347
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1348 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1349
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1350
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1351 Chunked-Body = *chunk
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1352 "0" CRLF
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1353 footer
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1354 CRLF
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1355
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1356 chunk = chunk-size [ chunk-ext ] CRLF
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1357 chunk-data CRLF
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1358
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1359 hex-no-zero = <HEX excluding "0">
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1360
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1361 chunk-size = hex-no-zero *HEX
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1362 chunk-ext = *( ";" chunk-ext-name [ "=" chunk-ext-value ] )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1363 chunk-ext-name = token
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1364 chunk-ext-val = token | quoted-string
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1365 chunk-data = chunk-size(OCTET)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1366
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1367 footer = *entity-header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1368
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1369 The chunked encoding is ended by a zero-sized chunk followed by the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1370 footer, which is terminated by an empty line. The purpose of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1371 footer is to provide an efficient way to supply information about an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1372 entity that is generated dynamically; applications MUST NOT send
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1373 header fields in the footer which are not explicitly defined as being
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1374 appropriate for the footer, such as Content-MD5 or future extensions
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1375 to HTTP for digital signatures or other facilities.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1376
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1377 An example process for decoding a Chunked-Body is presented in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1378 appendix 19.4.6.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1379
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1380 All HTTP/1.1 applications MUST be able to receive and decode the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1381 "chunked" transfer coding, and MUST ignore transfer coding extensions
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1382 they do not understand. A server which receives an entity-body with a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1383 transfer-coding it does not understand SHOULD return 501
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1384 (Unimplemented), and close the connection. A server MUST NOT send
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1385 transfer-codings to an HTTP/1.0 client.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1386
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1387 3.7 Media Types
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1388
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1389 HTTP uses Internet Media Types in the Content-Type (section 14.18)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1390 and Accept (section 14.1) header fields in order to provide open and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1391 extensible data typing and type negotiation.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1392
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1393 media-type = type "/" subtype *( ";" parameter )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1394 type = token
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1395 subtype = token
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1396
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1397 Parameters may follow the type/subtype in the form of attribute/value
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1398 pairs.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1399
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1400
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1401
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1402 Fielding, et. al. Standards Track [Page 25]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1403
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1404 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1405
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1406
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1407 parameter = attribute "=" value
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1408 attribute = token
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1409 value = token | quoted-string
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1410
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1411 The type, subtype, and parameter attribute names are case-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1412 insensitive. Parameter values may or may not be case-sensitive,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1413 depending on the semantics of the parameter name. Linear white space
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1414 (LWS) MUST NOT be used between the type and subtype, nor between an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1415 attribute and its value. User agents that recognize the media-type
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1416 MUST process (or arrange to be processed by any external applications
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1417 used to process that type/subtype by the user agent) the parameters
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1418 for that MIME type as described by that type/subtype definition to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1419 the and inform the user of any problems discovered.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1420
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1421 Note: some older HTTP applications do not recognize media type
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1422 parameters. When sending data to older HTTP applications,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1423 implementations should only use media type parameters when they are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1424 required by that type/subtype definition.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1425
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1426 Media-type values are registered with the Internet Assigned Number
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1427 Authority (IANA). The media type registration process is outlined in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1428 RFC 2048 [17]. Use of non-registered media types is discouraged.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1429
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1430 3.7.1 Canonicalization and Text Defaults
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1431
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1432 Internet media types are registered with a canonical form. In
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1433 general, an entity-body transferred via HTTP messages MUST be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1434 represented in the appropriate canonical form prior to its
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1435 transmission; the exception is "text" types, as defined in the next
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1436 paragraph.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1437
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1438 When in canonical form, media subtypes of the "text" type use CRLF as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1439 the text line break. HTTP relaxes this requirement and allows the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1440 transport of text media with plain CR or LF alone representing a line
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1441 break when it is done consistently for an entire entity-body. HTTP
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1442 applications MUST accept CRLF, bare CR, and bare LF as being
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1443 representative of a line break in text media received via HTTP. In
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1444 addition, if the text is represented in a character set that does not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1445 use octets 13 and 10 for CR and LF respectively, as is the case for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1446 some multi-byte character sets, HTTP allows the use of whatever octet
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1447 sequences are defined by that character set to represent the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1448 equivalent of CR and LF for line breaks. This flexibility regarding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1449 line breaks applies only to text media in the entity-body; a bare CR
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1450 or LF MUST NOT be substituted for CRLF within any of the HTTP control
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1451 structures (such as header fields and multipart boundaries).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1452
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1453 If an entity-body is encoded with a Content-Encoding, the underlying
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1454 data MUST be in a form defined above prior to being encoded.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1455
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1456
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1457
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1458 Fielding, et. al. Standards Track [Page 26]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1459
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1460 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1461
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1462
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1463 The "charset" parameter is used with some media types to define the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1464 character set (section 3.4) of the data. When no explicit charset
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1465 parameter is provided by the sender, media subtypes of the "text"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1466 type are defined to have a default charset value of "ISO-8859-1" when
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1467 received via HTTP. Data in character sets other than "ISO-8859-1" or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1468 its subsets MUST be labeled with an appropriate charset value.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1469
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1470 Some HTTP/1.0 software has interpreted a Content-Type header without
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1471 charset parameter incorrectly to mean "recipient should guess."
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1472 Senders wishing to defeat this behavior MAY include a charset
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1473 parameter even when the charset is ISO-8859-1 and SHOULD do so when
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1474 it is known that it will not confuse the recipient.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1475
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1476 Unfortunately, some older HTTP/1.0 clients did not deal properly with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1477 an explicit charset parameter. HTTP/1.1 recipients MUST respect the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1478 charset label provided by the sender; and those user agents that have
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1479 a provision to "guess" a charset MUST use the charset from the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1480 content-type field if they support that charset, rather than the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1481 recipient's preference, when initially displaying a document.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1482
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1483 3.7.2 Multipart Types
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1484
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1485 MIME provides for a number of "multipart" types -- encapsulations of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1486 one or more entities within a single message-body. All multipart
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1487 types share a common syntax, as defined in MIME [7], and MUST
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1488 include a boundary parameter as part of the media type value. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1489 message body is itself a protocol element and MUST therefore use only
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1490 CRLF to represent line breaks between body-parts. Unlike in MIME, the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1491 epilogue of any multipart message MUST be empty; HTTP applications
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1492 MUST NOT transmit the epilogue (even if the original multipart
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1493 contains an epilogue).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1494
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1495 In HTTP, multipart body-parts MAY contain header fields which are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1496 significant to the meaning of that part. A Content-Location header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1497 field (section 14.15) SHOULD be included in the body-part of each
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1498 enclosed entity that can be identified by a URL.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1499
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1500 In general, an HTTP user agent SHOULD follow the same or similar
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1501 behavior as a MIME user agent would upon receipt of a multipart type.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1502 If an application receives an unrecognized multipart subtype, the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1503 application MUST treat it as being equivalent to "multipart/mixed".
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1504
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1505 Note: The "multipart/form-data" type has been specifically defined
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1506 for carrying form data suitable for processing via the POST request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1507 method, as described in RFC 1867 [15].
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1508
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1509
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1510
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1511
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1512
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1513
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1514 Fielding, et. al. Standards Track [Page 27]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1515
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1516 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1517
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1518
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1519 3.8 Product Tokens
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1520
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1521 Product tokens are used to allow communicating applications to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1522 identify themselves by software name and version. Most fields using
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1523 product tokens also allow sub-products which form a significant part
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1524 of the application to be listed, separated by whitespace. By
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1525 convention, the products are listed in order of their significance
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1526 for identifying the application.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1527
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1528 product = token ["/" product-version]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1529 product-version = token
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1530
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1531 Examples:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1532
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1533 User-Agent: CERN-LineMode/2.15 libwww/2.17b3
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1534 Server: Apache/0.8.4
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1535
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1536 Product tokens should be short and to the point -- use of them for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1537 advertising or other non-essential information is explicitly
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1538 forbidden. Although any token character may appear in a product-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1539 version, this token SHOULD only be used for a version identifier
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1540 (i.e., successive versions of the same product SHOULD only differ in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1541 the product-version portion of the product value).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1542
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1543 3.9 Quality Values
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1544
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1545 HTTP content negotiation (section 12) uses short "floating point"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1546 numbers to indicate the relative importance ("weight") of various
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1547 negotiable parameters. A weight is normalized to a real number in the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1548 range 0 through 1, where 0 is the minimum and 1 the maximum value.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1549 HTTP/1.1 applications MUST NOT generate more than three digits after
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1550 the decimal point. User configuration of these values SHOULD also be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1551 limited in this fashion.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1552
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1553 qvalue = ( "0" [ "." 0*3DIGIT ] )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1554 | ( "1" [ "." 0*3("0") ] )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1555
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1556 "Quality values" is a misnomer, since these values merely represent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1557 relative degradation in desired quality.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1558
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1559 3.10 Language Tags
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1560
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1561 A language tag identifies a natural language spoken, written, or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1562 otherwise conveyed by human beings for communication of information
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1563 to other human beings. Computer languages are explicitly excluded.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1564 HTTP uses language tags within the Accept-Language and Content-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1565 Language fields.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1566
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1567
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1568
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1569
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1570 Fielding, et. al. Standards Track [Page 28]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1571
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1572 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1573
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1574
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1575 The syntax and registry of HTTP language tags is the same as that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1576 defined by RFC 1766 [1]. In summary, a language tag is composed of 1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1577 or more parts: A primary language tag and a possibly empty series of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1578 subtags:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1579
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1580 language-tag = primary-tag *( "-" subtag )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1581
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1582 primary-tag = 1*8ALPHA
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1583 subtag = 1*8ALPHA
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1584
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1585 Whitespace is not allowed within the tag and all tags are case-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1586 insensitive. The name space of language tags is administered by the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1587 IANA. Example tags include:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1588
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1589 en, en-US, en-cockney, i-cherokee, x-pig-latin
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1590
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1591 where any two-letter primary-tag is an ISO 639 language abbreviation
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1592 and any two-letter initial subtag is an ISO 3166 country code. (The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1593 last three tags above are not registered tags; all but the last are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1594 examples of tags which could be registered in future.)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1595
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1596 3.11 Entity Tags
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1597
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1598 Entity tags are used for comparing two or more entities from the same
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1599 requested resource. HTTP/1.1 uses entity tags in the ETag (section
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1600 14.20), If-Match (section 14.25), If-None-Match (section 14.26), and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1601 If-Range (section 14.27) header fields. The definition of how they
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1602 are used and compared as cache validators is in section 13.3.3. An
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1603 entity tag consists of an opaque quoted string, possibly prefixed by
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1604 a weakness indicator.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1605
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1606 entity-tag = [ weak ] opaque-tag
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1607
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1608 weak = "W/"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1609 opaque-tag = quoted-string
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1610
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1611 A "strong entity tag" may be shared by two entities of a resource
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1612 only if they are equivalent by octet equality.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1613
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1614 A "weak entity tag," indicated by the "W/" prefix, may be shared by
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1615 two entities of a resource only if the entities are equivalent and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1616 could be substituted for each other with no significant change in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1617 semantics. A weak entity tag can only be used for weak comparison.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1618
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1619 An entity tag MUST be unique across all versions of all entities
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1620 associated with a particular resource. A given entity tag value may
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1621 be used for entities obtained by requests on different URIs without
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1622 implying anything about the equivalence of those entities.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1623
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1624
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1625
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1626 Fielding, et. al. Standards Track [Page 29]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1627
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1628 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1629
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1630
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1631 3.12 Range Units
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1632
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1633 HTTP/1.1 allows a client to request that only part (a range of) the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1634 response entity be included within the response. HTTP/1.1 uses range
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1635 units in the Range (section 14.36) and Content-Range (section 14.17)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1636 header fields. An entity may be broken down into subranges according
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1637 to various structural units.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1638
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1639 range-unit = bytes-unit | other-range-unit
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1640
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1641 bytes-unit = "bytes"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1642 other-range-unit = token
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1643
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1644 The only range unit defined by HTTP/1.1 is "bytes". HTTP/1.1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1645 implementations may ignore ranges specified using other units.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1646 HTTP/1.1 has been designed to allow implementations of applications
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1647 that do not depend on knowledge of ranges.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1648
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1649 4 HTTP Message
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1650
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1651 4.1 Message Types
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1652
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1653 HTTP messages consist of requests from client to server and responses
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1654 from server to client.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1655
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1656 HTTP-message = Request | Response ; HTTP/1.1 messages
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1657
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1658 Request (section 5) and Response (section 6) messages use the generic
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1659 message format of RFC 822 [9] for transferring entities (the payload
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1660 of the message). Both types of message consist of a start-line, one
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1661 or more header fields (also known as "headers"), an empty line (i.e.,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1662 a line with nothing preceding the CRLF) indicating the end of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1663 header fields, and an optional message-body.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1664
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1665 generic-message = start-line
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1666 *message-header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1667 CRLF
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1668 [ message-body ]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1669
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1670 start-line = Request-Line | Status-Line
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1671
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1672 In the interest of robustness, servers SHOULD ignore any empty
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1673 line(s) received where a Request-Line is expected. In other words, if
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1674 the server is reading the protocol stream at the beginning of a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1675 message and receives a CRLF first, it should ignore the CRLF.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1676
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1677
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1678
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1679
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1680
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1681
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1682 Fielding, et. al. Standards Track [Page 30]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1683
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1684 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1685
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1686
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1687 Note: certain buggy HTTP/1.0 client implementations generate an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1688 extra CRLF's after a POST request. To restate what is explicitly
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1689 forbidden by the BNF, an HTTP/1.1 client must not preface or follow
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1690 a request with an extra CRLF.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1691
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1692 4.2 Message Headers
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1693
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1694 HTTP header fields, which include general-header (section 4.5),
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1695 request-header (section 5.3), response-header (section 6.2), and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1696 entity-header (section 7.1) fields, follow the same generic format as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1697 that given in Section 3.1 of RFC 822 [9]. Each header field consists
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1698 of a name followed by a colon (":") and the field value. Field names
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1699 are case-insensitive. The field value may be preceded by any amount
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1700 of LWS, though a single SP is preferred. Header fields can be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1701 extended over multiple lines by preceding each extra line with at
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1702 least one SP or HT. Applications SHOULD follow "common form" when
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1703 generating HTTP constructs, since there might exist some
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1704 implementations that fail to accept anything beyond the common forms.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1705
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1706 message-header = field-name ":" [ field-value ] CRLF
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1707
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1708 field-name = token
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1709 field-value = *( field-content | LWS )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1710
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1711 field-content = <the OCTETs making up the field-value
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1712 and consisting of either *TEXT or combinations
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1713 of token, tspecials, and quoted-string>
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1714
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1715 The order in which header fields with differing field names are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1716 received is not significant. However, it is "good practice" to send
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1717 general-header fields first, followed by request-header or response-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1718 header fields, and ending with the entity-header fields.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1719
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1720 Multiple message-header fields with the same field-name may be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1721 present in a message if and only if the entire field-value for that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1722 header field is defined as a comma-separated list [i.e., #(values)].
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1723 It MUST be possible to combine the multiple header fields into one
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1724 "field-name: field-value" pair, without changing the semantics of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1725 message, by appending each subsequent field-value to the first, each
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1726 separated by a comma. The order in which header fields with the same
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1727 field-name are received is therefore significant to the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1728 interpretation of the combined field value, and thus a proxy MUST NOT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1729 change the order of these field values when a message is forwarded.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1730
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1731
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1732
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1733
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1734
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1735
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1736
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1737
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1738 Fielding, et. al. Standards Track [Page 31]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1739
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1740 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1741
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1742
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1743 4.3 Message Body
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1744
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1745 The message-body (if any) of an HTTP message is used to carry the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1746 entity-body associated with the request or response. The message-body
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1747 differs from the entity-body only when a transfer coding has been
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1748 applied, as indicated by the Transfer-Encoding header field (section
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1749 14.40).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1750
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1751 message-body = entity-body
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1752 | <entity-body encoded as per Transfer-Encoding>
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1753
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1754 Transfer-Encoding MUST be used to indicate any transfer codings
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1755 applied by an application to ensure safe and proper transfer of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1756 message. Transfer-Encoding is a property of the message, not of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1757 entity, and thus can be added or removed by any application along the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1758 request/response chain.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1759
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1760 The rules for when a message-body is allowed in a message differ for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1761 requests and responses.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1762
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1763 The presence of a message-body in a request is signaled by the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1764 inclusion of a Content-Length or Transfer-Encoding header field in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1765 the request's message-headers. A message-body MAY be included in a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1766 request only when the request method (section 5.1.1) allows an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1767 entity-body.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1768
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1769 For response messages, whether or not a message-body is included with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1770 a message is dependent on both the request method and the response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1771 status code (section 6.1.1). All responses to the HEAD request method
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1772 MUST NOT include a message-body, even though the presence of entity-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1773 header fields might lead one to believe they do. All 1xx
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1774 (informational), 204 (no content), and 304 (not modified) responses
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1775 MUST NOT include a message-body. All other responses do include a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1776 message-body, although it may be of zero length.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1777
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1778 4.4 Message Length
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1779
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1780 When a message-body is included with a message, the length of that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1781 body is determined by one of the following (in order of precedence):
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1782
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1783 1. Any response message which MUST NOT include a message-body
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1784 (such as the 1xx, 204, and 304 responses and any response to a HEAD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1785 request) is always terminated by the first empty line after the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1786 header fields, regardless of the entity-header fields present in the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1787 message.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1788
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1789 2. If a Transfer-Encoding header field (section 14.40) is present and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1790 indicates that the "chunked" transfer coding has been applied, then
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1791
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1792
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1793
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1794 Fielding, et. al. Standards Track [Page 32]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1795
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1796 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1797
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1798
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1799 the length is defined by the chunked encoding (section 3.6).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1800
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1801 3. If a Content-Length header field (section 14.14) is present, its
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1802 value in bytes represents the length of the message-body.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1803
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1804 4. If the message uses the media type "multipart/byteranges", which is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1805 self-delimiting, then that defines the length. This media type MUST
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1806 NOT be used unless the sender knows that the recipient can parse it;
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1807 the presence in a request of a Range header with multiple byte-range
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1808 specifiers implies that the client can parse multipart/byteranges
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1809 responses.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1810
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1811 5. By the server closing the connection. (Closing the connection
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1812 cannot be used to indicate the end of a request body, since that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1813 would leave no possibility for the server to send back a response.)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1814
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1815 For compatibility with HTTP/1.0 applications, HTTP/1.1 requests
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1816 containing a message-body MUST include a valid Content-Length header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1817 field unless the server is known to be HTTP/1.1 compliant. If a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1818 request contains a message-body and a Content-Length is not given,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1819 the server SHOULD respond with 400 (bad request) if it cannot
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1820 determine the length of the message, or with 411 (length required) if
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1821 it wishes to insist on receiving a valid Content-Length.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1822
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1823 All HTTP/1.1 applications that receive entities MUST accept the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1824 "chunked" transfer coding (section 3.6), thus allowing this mechanism
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1825 to be used for messages when the message length cannot be determined
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1826 in advance.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1827
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1828 Messages MUST NOT include both a Content-Length header field and the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1829 "chunked" transfer coding. If both are received, the Content-Length
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1830 MUST be ignored.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1831
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1832 When a Content-Length is given in a message where a message-body is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1833 allowed, its field value MUST exactly match the number of OCTETs in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1834 the message-body. HTTP/1.1 user agents MUST notify the user when an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1835 invalid length is received and detected.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1836
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1837
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1838
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1839
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1840
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1841
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1842
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1843
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1844
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1845
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1846
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1847
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1848
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1849
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1850 Fielding, et. al. Standards Track [Page 33]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1851
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1852 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1853
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1854
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1855 4.5 General Header Fields
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1856
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1857 There are a few header fields which have general applicability for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1858 both request and response messages, but which do not apply to the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1859 entity being transferred. These header fields apply only to the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1860 message being transmitted.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1861
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1862 general-header = Cache-Control ; Section 14.9
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1863 | Connection ; Section 14.10
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1864 | Date ; Section 14.19
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1865 | Pragma ; Section 14.32
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1866 | Transfer-Encoding ; Section 14.40
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1867 | Upgrade ; Section 14.41
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1868 | Via ; Section 14.44
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1869
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1870 General-header field names can be extended reliably only in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1871 combination with a change in the protocol version. However, new or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1872 experimental header fields may be given the semantics of general
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1873 header fields if all parties in the communication recognize them to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1874 be general-header fields. Unrecognized header fields are treated as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1875 entity-header fields.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1876
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1877 5 Request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1878
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1879 A request message from a client to a server includes, within the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1880 first line of that message, the method to be applied to the resource,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1881 the identifier of the resource, and the protocol version in use.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1882
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1883 Request = Request-Line ; Section 5.1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1884 *( general-header ; Section 4.5
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1885 | request-header ; Section 5.3
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1886 | entity-header ) ; Section 7.1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1887 CRLF
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1888 [ message-body ] ; Section 7.2
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1889
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1890 5.1 Request-Line
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1891
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1892 The Request-Line begins with a method token, followed by the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1893 Request-URI and the protocol version, and ending with CRLF. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1894 elements are separated by SP characters. No CR or LF are allowed
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1895 except in the final CRLF sequence.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1896
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1897 Request-Line = Method SP Request-URI SP HTTP-Version CRLF
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1898
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1899
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1900
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1901
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1902
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1903
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1904
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1905
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1906 Fielding, et. al. Standards Track [Page 34]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1907
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1908 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1909
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1910
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1911 5.1.1 Method
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1912
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1913 The Method token indicates the method to be performed on the resource
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1914 identified by the Request-URI. The method is case-sensitive.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1915
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1916 Method = "OPTIONS" ; Section 9.2
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1917 | "GET" ; Section 9.3
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1918 | "HEAD" ; Section 9.4
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1919 | "POST" ; Section 9.5
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1920 | "PUT" ; Section 9.6
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1921 | "DELETE" ; Section 9.7
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1922 | "TRACE" ; Section 9.8
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1923 | extension-method
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1924
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1925 extension-method = token
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1926
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1927 The list of methods allowed by a resource can be specified in an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1928 Allow header field (section 14.7). The return code of the response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1929 always notifies the client whether a method is currently allowed on a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1930 resource, since the set of allowed methods can change dynamically.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1931 Servers SHOULD return the status code 405 (Method Not Allowed) if the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1932 method is known by the server but not allowed for the requested
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1933 resource, and 501 (Not Implemented) if the method is unrecognized or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1934 not implemented by the server. The list of methods known by a server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1935 can be listed in a Public response-header field (section 14.35).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1936
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1937 The methods GET and HEAD MUST be supported by all general-purpose
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1938 servers. All other methods are optional; however, if the above
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1939 methods are implemented, they MUST be implemented with the same
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1940 semantics as those specified in section 9.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1941
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1942 5.1.2 Request-URI
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1943
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1944 The Request-URI is a Uniform Resource Identifier (section 3.2) and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1945 identifies the resource upon which to apply the request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1946
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1947 Request-URI = "*" | absoluteURI | abs_path
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1948
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1949 The three options for Request-URI are dependent on the nature of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1950 request. The asterisk "*" means that the request does not apply to a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1951 particular resource, but to the server itself, and is only allowed
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1952 when the method used does not necessarily apply to a resource. One
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1953 example would be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1954
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1955 OPTIONS * HTTP/1.1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1956
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1957 The absoluteURI form is required when the request is being made to a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1958 proxy. The proxy is requested to forward the request or service it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1959
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1960
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1961
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1962 Fielding, et. al. Standards Track [Page 35]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1963
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1964 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1965
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1966
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1967 from a valid cache, and return the response. Note that the proxy MAY
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1968 forward the request on to another proxy or directly to the server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1969 specified by the absoluteURI. In order to avoid request loops, a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1970 proxy MUST be able to recognize all of its server names, including
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1971 any aliases, local variations, and the numeric IP address. An example
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1972 Request-Line would be:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1973
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1974 GET http://www.w3.org/pub/WWW/TheProject.html HTTP/1.1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1975
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1976 To allow for transition to absoluteURIs in all requests in future
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1977 versions of HTTP, all HTTP/1.1 servers MUST accept the absoluteURI
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1978 form in requests, even though HTTP/1.1 clients will only generate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1979 them in requests to proxies.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1980
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1981 The most common form of Request-URI is that used to identify a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1982 resource on an origin server or gateway. In this case the absolute
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1983 path of the URI MUST be transmitted (see section 3.2.1, abs_path) as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1984 the Request-URI, and the network location of the URI (net_loc) MUST
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1985 be transmitted in a Host header field. For example, a client wishing
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1986 to retrieve the resource above directly from the origin server would
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1987 create a TCP connection to port 80 of the host "www.w3.org" and send
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1988 the lines:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1989
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1990 GET /pub/WWW/TheProject.html HTTP/1.1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1991 Host: www.w3.org
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1992
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1993 followed by the remainder of the Request. Note that the absolute path
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1994 cannot be empty; if none is present in the original URI, it MUST be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1995 given as "/" (the server root).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1996
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1997 If a proxy receives a request without any path in the Request-URI and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1998 the method specified is capable of supporting the asterisk form of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1999 request, then the last proxy on the request chain MUST forward the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2000 request with "*" as the final Request-URI. For example, the request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2001
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2002 OPTIONS http://www.ics.uci.edu:8001 HTTP/1.1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2003
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2004 would be forwarded by the proxy as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2005
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2006 OPTIONS * HTTP/1.1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2007 Host: www.ics.uci.edu:8001
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2008
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2009 after connecting to port 8001 of host "www.ics.uci.edu".
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2010
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2011 The Request-URI is transmitted in the format specified in section
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2012 3.2.1. The origin server MUST decode the Request-URI in order to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2013 properly interpret the request. Servers SHOULD respond to invalid
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2014 Request-URIs with an appropriate status code.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2015
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2016
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2017
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2018 Fielding, et. al. Standards Track [Page 36]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2019
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2020 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2021
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2022
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2023 In requests that they forward, proxies MUST NOT rewrite the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2024 "abs_path" part of a Request-URI in any way except as noted above to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2025 replace a null abs_path with "*", no matter what the proxy does in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2026 its internal implementation.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2027
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2028 Note: The "no rewrite" rule prevents the proxy from changing the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2029 meaning of the request when the origin server is improperly using a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2030 non-reserved URL character for a reserved purpose. Implementers
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2031 should be aware that some pre-HTTP/1.1 proxies have been known to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2032 rewrite the Request-URI.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2033
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2034 5.2 The Resource Identified by a Request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2035
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2036 HTTP/1.1 origin servers SHOULD be aware that the exact resource
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2037 identified by an Internet request is determined by examining both the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2038 Request-URI and the Host header field.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2039
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2040 An origin server that does not allow resources to differ by the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2041 requested host MAY ignore the Host header field value. (But see
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2042 section 19.5.1 for other requirements on Host support in HTTP/1.1.)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2043
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2044 An origin server that does differentiate resources based on the host
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2045 requested (sometimes referred to as virtual hosts or vanity
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2046 hostnames) MUST use the following rules for determining the requested
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2047 resource on an HTTP/1.1 request:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2048
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2049 1. If Request-URI is an absoluteURI, the host is part of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2050 Request-URI. Any Host header field value in the request MUST be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2051 ignored.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2052
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2053 2. If the Request-URI is not an absoluteURI, and the request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2054 includes a Host header field, the host is determined by the Host
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2055 header field value.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2056
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2057 3. If the host as determined by rule 1 or 2 is not a valid host on
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2058 the server, the response MUST be a 400 (Bad Request) error
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2059 message.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2060
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2061 Recipients of an HTTP/1.0 request that lacks a Host header field MAY
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2062 attempt to use heuristics (e.g., examination of the URI path for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2063 something unique to a particular host) in order to determine what
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2064 exact resource is being requested.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2065
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2066 5.3 Request Header Fields
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2067
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2068 The request-header fields allow the client to pass additional
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2069 information about the request, and about the client itself, to the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2070 server. These fields act as request modifiers, with semantics
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2071
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2072
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2073
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2074 Fielding, et. al. Standards Track [Page 37]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2075
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2076 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2077
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2078
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2079 equivalent to the parameters on a programming language method
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2080 invocation.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2081
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2082 request-header = Accept ; Section 14.1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2083 | Accept-Charset ; Section 14.2
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2084 | Accept-Encoding ; Section 14.3
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2085 | Accept-Language ; Section 14.4
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2086 | Authorization ; Section 14.8
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2087 | From ; Section 14.22
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2088 | Host ; Section 14.23
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2089 | If-Modified-Since ; Section 14.24
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2090 | If-Match ; Section 14.25
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2091 | If-None-Match ; Section 14.26
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2092 | If-Range ; Section 14.27
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2093 | If-Unmodified-Since ; Section 14.28
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2094 | Max-Forwards ; Section 14.31
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2095 | Proxy-Authorization ; Section 14.34
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2096 | Range ; Section 14.36
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2097 | Referer ; Section 14.37
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2098 | User-Agent ; Section 14.42
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2099
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2100 Request-header field names can be extended reliably only in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2101 combination with a change in the protocol version. However, new or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2102 experimental header fields MAY be given the semantics of request-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2103 header fields if all parties in the communication recognize them to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2104 be request-header fields. Unrecognized header fields are treated as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2105 entity-header fields.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2106
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2107 6 Response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2108
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2109 After receiving and interpreting a request message, a server responds
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2110 with an HTTP response message.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2111
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2112 Response = Status-Line ; Section 6.1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2113 *( general-header ; Section 4.5
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2114 | response-header ; Section 6.2
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2115 | entity-header ) ; Section 7.1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2116 CRLF
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2117 [ message-body ] ; Section 7.2
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2118
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2119 6.1 Status-Line
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2120
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2121 The first line of a Response message is the Status-Line, consisting
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2122 of the protocol version followed by a numeric status code and its
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2123 associated textual phrase, with each element separated by SP
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2124 characters. No CR or LF is allowed except in the final CRLF
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2125 sequence.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2126
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2127
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2128
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2129
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2130 Fielding, et. al. Standards Track [Page 38]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2131
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2132 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2133
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2134
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2135 Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2136
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2137 6.1.1 Status Code and Reason Phrase
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2138
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2139 The Status-Code element is a 3-digit integer result code of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2140 attempt to understand and satisfy the request. These codes are fully
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2141 defined in section 10. The Reason-Phrase is intended to give a short
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2142 textual description of the Status-Code. The Status-Code is intended
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2143 for use by automata and the Reason-Phrase is intended for the human
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2144 user. The client is not required to examine or display the Reason-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2145 Phrase.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2146
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2147 The first digit of the Status-Code defines the class of response. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2148 last two digits do not have any categorization role. There are 5
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2149 values for the first digit:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2150
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2151 o 1xx: Informational - Request received, continuing process
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2152
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2153 o 2xx: Success - The action was successfully received, understood,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2154 and accepted
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2155
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2156 o 3xx: Redirection - Further action must be taken in order to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2157 complete the request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2158
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2159 o 4xx: Client Error - The request contains bad syntax or cannot be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2160 fulfilled
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2161
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2162 o 5xx: Server Error - The server failed to fulfill an apparently
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2163 valid request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2164
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2165 The individual values of the numeric status codes defined for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2166 HTTP/1.1, and an example set of corresponding Reason-Phrase's, are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2167 presented below. The reason phrases listed here are only recommended
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2168 -- they may be replaced by local equivalents without affecting the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2169 protocol.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2170
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2171 Status-Code = "100" ; Continue
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2172 | "101" ; Switching Protocols
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2173 | "200" ; OK
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2174 | "201" ; Created
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2175 | "202" ; Accepted
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2176 | "203" ; Non-Authoritative Information
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2177 | "204" ; No Content
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2178 | "205" ; Reset Content
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2179 | "206" ; Partial Content
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2180 | "300" ; Multiple Choices
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2181 | "301" ; Moved Permanently
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2182 | "302" ; Moved Temporarily
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2183
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2184
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2185
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2186 Fielding, et. al. Standards Track [Page 39]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2187
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2188 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2189
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2190
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2191 | "303" ; See Other
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2192 | "304" ; Not Modified
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2193 | "305" ; Use Proxy
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2194 | "400" ; Bad Request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2195 | "401" ; Unauthorized
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2196 | "402" ; Payment Required
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2197 | "403" ; Forbidden
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2198 | "404" ; Not Found
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2199 | "405" ; Method Not Allowed
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2200 | "406" ; Not Acceptable
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2201 | "407" ; Proxy Authentication Required
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2202 | "408" ; Request Time-out
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2203 | "409" ; Conflict
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2204 | "410" ; Gone
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2205 | "411" ; Length Required
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2206 | "412" ; Precondition Failed
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2207 | "413" ; Request Entity Too Large
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2208 | "414" ; Request-URI Too Large
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2209 | "415" ; Unsupported Media Type
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2210 | "500" ; Internal Server Error
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2211 | "501" ; Not Implemented
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2212 | "502" ; Bad Gateway
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2213 | "503" ; Service Unavailable
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2214 | "504" ; Gateway Time-out
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2215 | "505" ; HTTP Version not supported
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2216 | extension-code
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2217
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2218 extension-code = 3DIGIT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2219
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2220 Reason-Phrase = *<TEXT, excluding CR, LF>
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2221
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2222 HTTP status codes are extensible. HTTP applications are not required
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2223 to understand the meaning of all registered status codes, though such
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2224 understanding is obviously desirable. However, applications MUST
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2225 understand the class of any status code, as indicated by the first
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2226 digit, and treat any unrecognized response as being equivalent to the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2227 x00 status code of that class, with the exception that an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2228 unrecognized response MUST NOT be cached. For example, if an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2229 unrecognized status code of 431 is received by the client, it can
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2230 safely assume that there was something wrong with its request and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2231 treat the response as if it had received a 400 status code. In such
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2232 cases, user agents SHOULD present to the user the entity returned
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2233 with the response, since that entity is likely to include human-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2234 readable information which will explain the unusual status.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2235
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2236
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2237
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2238
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2239
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2240
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2241
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2242 Fielding, et. al. Standards Track [Page 40]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2243
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2244 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2245
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2246
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2247 6.2 Response Header Fields
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2248
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2249 The response-header fields allow the server to pass additional
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2250 information about the response which cannot be placed in the Status-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2251 Line. These header fields give information about the server and about
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2252 further access to the resource identified by the Request-URI.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2253
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2254 response-header = Age ; Section 14.6
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2255 | Location ; Section 14.30
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2256 | Proxy-Authenticate ; Section 14.33
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2257 | Public ; Section 14.35
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2258 | Retry-After ; Section 14.38
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2259 | Server ; Section 14.39
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2260 | Vary ; Section 14.43
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2261 | Warning ; Section 14.45
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2262 | WWW-Authenticate ; Section 14.46
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2263
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2264 Response-header field names can be extended reliably only in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2265 combination with a change in the protocol version. However, new or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2266 experimental header fields MAY be given the semantics of response-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2267 header fields if all parties in the communication recognize them to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2268 be response-header fields. Unrecognized header fields are treated as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2269 entity-header fields.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2270
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2271 7 Entity
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2272
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2273 Request and Response messages MAY transfer an entity if not otherwise
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2274 restricted by the request method or response status code. An entity
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2275 consists of entity-header fields and an entity-body, although some
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2276 responses will only include the entity-headers.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2277
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2278 In this section, both sender and recipient refer to either the client
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2279 or the server, depending on who sends and who receives the entity.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2280
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2281 7.1 Entity Header Fields
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2282
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2283 Entity-header fields define optional metainformation about the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2284 entity-body or, if no body is present, about the resource identified
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2285 by the request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2286
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2287
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2288
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2289
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2290
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2291
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2292
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2293
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2294
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2295
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2296
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2297
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2298 Fielding, et. al. Standards Track [Page 41]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2299
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2300 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2301
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2302
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2303 entity-header = Allow ; Section 14.7
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2304 | Content-Base ; Section 14.11
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2305 | Content-Encoding ; Section 14.12
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2306 | Content-Language ; Section 14.13
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2307 | Content-Length ; Section 14.14
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2308 | Content-Location ; Section 14.15
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2309 | Content-MD5 ; Section 14.16
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2310 | Content-Range ; Section 14.17
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2311 | Content-Type ; Section 14.18
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2312 | ETag ; Section 14.20
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2313 | Expires ; Section 14.21
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2314 | Last-Modified ; Section 14.29
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2315 | extension-header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2316
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2317 extension-header = message-header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2318
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2319 The extension-header mechanism allows additional entity-header fields
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2320 to be defined without changing the protocol, but these fields cannot
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2321 be assumed to be recognizable by the recipient. Unrecognized header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2322 fields SHOULD be ignored by the recipient and forwarded by proxies.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2323
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2324 7.2 Entity Body
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2325
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2326 The entity-body (if any) sent with an HTTP request or response is in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2327 a format and encoding defined by the entity-header fields.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2328
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2329 entity-body = *OCTET
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2330
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2331 An entity-body is only present in a message when a message-body is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2332 present, as described in section 4.3. The entity-body is obtained
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2333 from the message-body by decoding any Transfer-Encoding that may have
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2334 been applied to ensure safe and proper transfer of the message.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2335
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2336 7.2.1 Type
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2337
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2338 When an entity-body is included with a message, the data type of that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2339 body is determined via the header fields Content-Type and Content-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2340 Encoding. These define a two-layer, ordered encoding model:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2341
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2342 entity-body := Content-Encoding( Content-Type( data ) )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2343
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2344 Content-Type specifies the media type of the underlying data.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2345 Content-Encoding may be used to indicate any additional content
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2346 codings applied to the data, usually for the purpose of data
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2347 compression, that are a property of the requested resource. There is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2348 no default encoding.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2349
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2350
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2351
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2352
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2353
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2354 Fielding, et. al. Standards Track [Page 42]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2355
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2356 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2357
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2358
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2359 Any HTTP/1.1 message containing an entity-body SHOULD include a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2360 Content-Type header field defining the media type of that body. If
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2361 and only if the media type is not given by a Content-Type field, the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2362 recipient MAY attempt to guess the media type via inspection of its
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2363 content and/or the name extension(s) of the URL used to identify the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2364 resource. If the media type remains unknown, the recipient SHOULD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2365 treat it as type "application/octet-stream".
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2366
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2367 7.2.2 Length
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2368
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2369 The length of an entity-body is the length of the message-body after
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2370 any transfer codings have been removed. Section 4.4 defines how the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2371 length of a message-body is determined.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2372
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2373 8 Connections
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2374
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2375 8.1 Persistent Connections
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2376
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2377 8.1.1 Purpose
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2378
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2379 Prior to persistent connections, a separate TCP connection was
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2380 established to fetch each URL, increasing the load on HTTP servers
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2381 and causing congestion on the Internet. The use of inline images and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2382 other associated data often requires a client to make multiple
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2383 requests of the same server in a short amount of time. Analyses of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2384 these performance problems are available [30][27]; analysis and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2385 results from a prototype implementation are in [26].
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2386
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2387 Persistent HTTP connections have a number of advantages:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2388
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2389 o By opening and closing fewer TCP connections, CPU time is saved,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2390 and memory used for TCP protocol control blocks is also saved.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2391 o HTTP requests and responses can be pipelined on a connection.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2392 Pipelining allows a client to make multiple requests without
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2393 waiting for each response, allowing a single TCP connection to be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2394 used much more efficiently, with much lower elapsed time.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2395 o Network congestion is reduced by reducing the number of packets
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2396 caused by TCP opens, and by allowing TCP sufficient time to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2397 determine the congestion state of the network.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2398 o HTTP can evolve more gracefully; since errors can be reported
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2399 without the penalty of closing the TCP connection. Clients using
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2400 future versions of HTTP might optimistically try a new feature, but
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2401 if communicating with an older server, retry with old semantics
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2402 after an error is reported.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2403
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2404 HTTP implementations SHOULD implement persistent connections.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2405
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2406
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2407
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2408
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2409
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2410 Fielding, et. al. Standards Track [Page 43]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2411
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2412 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2413
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2414
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2415 8.1.2 Overall Operation
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2416
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2417 A significant difference between HTTP/1.1 and earlier versions of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2418 HTTP is that persistent connections are the default behavior of any
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2419 HTTP connection. That is, unless otherwise indicated, the client may
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2420 assume that the server will maintain a persistent connection.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2421
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2422 Persistent connections provide a mechanism by which a client and a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2423 server can signal the close of a TCP connection. This signaling takes
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2424 place using the Connection header field. Once a close has been
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2425 signaled, the client MUST not send any more requests on that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2426 connection.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2427
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2428 8.1.2.1 Negotiation
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2429
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2430 An HTTP/1.1 server MAY assume that a HTTP/1.1 client intends to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2431 maintain a persistent connection unless a Connection header including
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2432 the connection-token "close" was sent in the request. If the server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2433 chooses to close the connection immediately after sending the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2434 response, it SHOULD send a Connection header including the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2435 connection-token close.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2436
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2437 An HTTP/1.1 client MAY expect a connection to remain open, but would
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2438 decide to keep it open based on whether the response from a server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2439 contains a Connection header with the connection-token close. In case
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2440 the client does not want to maintain a connection for more than that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2441 request, it SHOULD send a Connection header including the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2442 connection-token close.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2443
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2444 If either the client or the server sends the close token in the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2445 Connection header, that request becomes the last one for the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2446 connection.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2447
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2448 Clients and servers SHOULD NOT assume that a persistent connection is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2449 maintained for HTTP versions less than 1.1 unless it is explicitly
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2450 signaled. See section 19.7.1 for more information on backwards
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2451 compatibility with HTTP/1.0 clients.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2452
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2453 In order to remain persistent, all messages on the connection must
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2454 have a self-defined message length (i.e., one not defined by closure
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2455 of the connection), as described in section 4.4.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2456
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2457 8.1.2.2 Pipelining
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2458
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2459 A client that supports persistent connections MAY "pipeline" its
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2460 requests (i.e., send multiple requests without waiting for each
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2461 response). A server MUST send its responses to those requests in the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2462 same order that the requests were received.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2463
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2464
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2465
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2466 Fielding, et. al. Standards Track [Page 44]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2467
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2468 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2469
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2470
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2471 Clients which assume persistent connections and pipeline immediately
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2472 after connection establishment SHOULD be prepared to retry their
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2473 connection if the first pipelined attempt fails. If a client does
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2474 such a retry, it MUST NOT pipeline before it knows the connection is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2475 persistent. Clients MUST also be prepared to resend their requests if
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2476 the server closes the connection before sending all of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2477 corresponding responses.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2478
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2479 8.1.3 Proxy Servers
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2480
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2481 It is especially important that proxies correctly implement the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2482 properties of the Connection header field as specified in 14.2.1.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2483
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2484 The proxy server MUST signal persistent connections separately with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2485 its clients and the origin servers (or other proxy servers) that it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2486 connects to. Each persistent connection applies to only one transport
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2487 link.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2488
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2489 A proxy server MUST NOT establish a persistent connection with an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2490 HTTP/1.0 client.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2491
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2492 8.1.4 Practical Considerations
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2493
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2494 Servers will usually have some time-out value beyond which they will
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2495 no longer maintain an inactive connection. Proxy servers might make
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2496 this a higher value since it is likely that the client will be making
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2497 more connections through the same server. The use of persistent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2498 connections places no requirements on the length of this time-out for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2499 either the client or the server.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2500
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2501 When a client or server wishes to time-out it SHOULD issue a graceful
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2502 close on the transport connection. Clients and servers SHOULD both
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2503 constantly watch for the other side of the transport close, and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2504 respond to it as appropriate. If a client or server does not detect
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2505 the other side's close promptly it could cause unnecessary resource
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2506 drain on the network.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2507
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2508 A client, server, or proxy MAY close the transport connection at any
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2509 time. For example, a client MAY have started to send a new request at
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2510 the same time that the server has decided to close the "idle"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2511 connection. From the server's point of view, the connection is being
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2512 closed while it was idle, but from the client's point of view, a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2513 request is in progress.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2514
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2515 This means that clients, servers, and proxies MUST be able to recover
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2516 from asynchronous close events. Client software SHOULD reopen the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2517 transport connection and retransmit the aborted request without user
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2518 interaction so long as the request method is idempotent (see section
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2519
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2520
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2521
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2522 Fielding, et. al. Standards Track [Page 45]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2523
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2524 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2525
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2526
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2527 9.1.2); other methods MUST NOT be automatically retried, although
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2528 user agents MAY offer a human operator the choice of retrying the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2529 request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2530
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2531 However, this automatic retry SHOULD NOT be repeated if the second
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2532 request fails.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2533
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2534 Servers SHOULD always respond to at least one request per connection,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2535 if at all possible. Servers SHOULD NOT close a connection in the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2536 middle of transmitting a response, unless a network or client failure
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2537 is suspected.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2538
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2539 Clients that use persistent connections SHOULD limit the number of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2540 simultaneous connections that they maintain to a given server. A
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2541 single-user client SHOULD maintain AT MOST 2 connections with any
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2542 server or proxy. A proxy SHOULD use up to 2*N connections to another
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2543 server or proxy, where N is the number of simultaneously active
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2544 users. These guidelines are intended to improve HTTP response times
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2545 and avoid congestion of the Internet or other networks.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2546
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2547 8.2 Message Transmission Requirements
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2548
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2549 General requirements:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2550
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2551 o HTTP/1.1 servers SHOULD maintain persistent connections and use
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2552 TCP's flow control mechanisms to resolve temporary overloads,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2553 rather than terminating connections with the expectation that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2554 clients will retry. The latter technique can exacerbate network
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2555 congestion.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2556
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2557 o An HTTP/1.1 (or later) client sending a message-body SHOULD monitor
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2558 the network connection for an error status while it is transmitting
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2559 the request. If the client sees an error status, it SHOULD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2560 immediately cease transmitting the body. If the body is being sent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2561 using a "chunked" encoding (section 3.6), a zero length chunk and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2562 empty footer MAY be used to prematurely mark the end of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2563 message. If the body was preceded by a Content-Length header, the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2564 client MUST close the connection.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2565
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2566 o An HTTP/1.1 (or later) client MUST be prepared to accept a 100
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2567 (Continue) status followed by a regular response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2568
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2569 o An HTTP/1.1 (or later) server that receives a request from a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2570 HTTP/1.0 (or earlier) client MUST NOT transmit the 100 (continue)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2571 response; it SHOULD either wait for the request to be completed
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2572 normally (thus avoiding an interrupted request) or close the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2573 connection prematurely.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2574
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2575
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2576
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2577
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2578 Fielding, et. al. Standards Track [Page 46]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2579
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2580 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2581
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2582
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2583 Upon receiving a method subject to these requirements from an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2584 HTTP/1.1 (or later) client, an HTTP/1.1 (or later) server MUST either
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2585 respond with 100 (Continue) status and continue to read from the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2586 input stream, or respond with an error status. If it responds with an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2587 error status, it MAY close the transport (TCP) connection or it MAY
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2588 continue to read and discard the rest of the request. It MUST NOT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2589 perform the requested method if it returns an error status.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2590
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2591 Clients SHOULD remember the version number of at least the most
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2592 recently used server; if an HTTP/1.1 client has seen an HTTP/1.1 or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2593 later response from the server, and it sees the connection close
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2594 before receiving any status from the server, the client SHOULD retry
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2595 the request without user interaction so long as the request method is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2596 idempotent (see section 9.1.2); other methods MUST NOT be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2597 automatically retried, although user agents MAY offer a human
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2598 operator the choice of retrying the request.. If the client does
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2599 retry the request, the client
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2600
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2601 o MUST first send the request header fields, and then
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2602
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2603 o MUST wait for the server to respond with either a 100 (Continue)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2604 response, in which case the client should continue, or with an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2605 error status.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2606
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2607 If an HTTP/1.1 client has not seen an HTTP/1.1 or later response from
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2608 the server, it should assume that the server implements HTTP/1.0 or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2609 older and will not use the 100 (Continue) response. If in this case
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2610 the client sees the connection close before receiving any status from
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2611 the server, the client SHOULD retry the request. If the client does
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2612 retry the request to this HTTP/1.0 server, it should use the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2613 following "binary exponential backoff" algorithm to be assured of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2614 obtaining a reliable response:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2615
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2616 1. Initiate a new connection to the server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2617
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2618 2. Transmit the request-headers
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2619
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2620 3. Initialize a variable R to the estimated round-trip time to the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2621 server (e.g., based on the time it took to establish the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2622 connection), or to a constant value of 5 seconds if the round-trip
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2623 time is not available.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2624
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2625 4. Compute T = R * (2**N), where N is the number of previous retries
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2626 of this request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2627
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2628 5. Wait either for an error response from the server, or for T seconds
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2629 (whichever comes first)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2630
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2631
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2632
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2633
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2634 Fielding, et. al. Standards Track [Page 47]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2635
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2636 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2637
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2638
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2639 6. If no error response is received, after T seconds transmit the body
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2640 of the request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2641
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2642 7. If client sees that the connection is closed prematurely, repeat
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2643 from step 1 until the request is accepted, an error response is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2644 received, or the user becomes impatient and terminates the retry
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2645 process.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2646
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2647 No matter what the server version, if an error status is received,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2648 the client
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2649
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2650 o MUST NOT continue and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2651
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2652 o MUST close the connection if it has not completed sending the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2653 message.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2654
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2655 An HTTP/1.1 (or later) client that sees the connection close after
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2656 receiving a 100 (Continue) but before receiving any other status
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2657 SHOULD retry the request, and need not wait for 100 (Continue)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2658 response (but MAY do so if this simplifies the implementation).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2659
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2660 9 Method Definitions
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2661
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2662 The set of common methods for HTTP/1.1 is defined below. Although
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2663 this set can be expanded, additional methods cannot be assumed to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2664 share the same semantics for separately extended clients and servers.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2665
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2666 The Host request-header field (section 14.23) MUST accompany all
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2667 HTTP/1.1 requests.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2668
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2669 9.1 Safe and Idempotent Methods
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2670
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2671 9.1.1 Safe Methods
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2672
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2673 Implementers should be aware that the software represents the user in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2674 their interactions over the Internet, and should be careful to allow
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2675 the user to be aware of any actions they may take which may have an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2676 unexpected significance to themselves or others.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2677
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2678 In particular, the convention has been established that the GET and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2679 HEAD methods should never have the significance of taking an action
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2680 other than retrieval. These methods should be considered "safe." This
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2681 allows user agents to represent other methods, such as POST, PUT and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2682 DELETE, in a special way, so that the user is made aware of the fact
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2683 that a possibly unsafe action is being requested.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2684
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2685 Naturally, it is not possible to ensure that the server does not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2686 generate side-effects as a result of performing a GET request; in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2687
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2688
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2689
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2690 Fielding, et. al. Standards Track [Page 48]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2691
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2692 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2693
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2694
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2695 fact, some dynamic resources consider that a feature. The important
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2696 distinction here is that the user did not request the side-effects,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2697 so therefore cannot be held accountable for them.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2698
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2699 9.1.2 Idempotent Methods
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2700
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2701 Methods may also have the property of "idempotence" in that (aside
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2702 from error or expiration issues) the side-effects of N > 0 identical
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2703 requests is the same as for a single request. The methods GET, HEAD,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2704 PUT and DELETE share this property.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2705
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2706 9.2 OPTIONS
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2707
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2708 The OPTIONS method represents a request for information about the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2709 communication options available on the request/response chain
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2710 identified by the Request-URI. This method allows the client to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2711 determine the options and/or requirements associated with a resource,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2712 or the capabilities of a server, without implying a resource action
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2713 or initiating a resource retrieval.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2714
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2715 Unless the server's response is an error, the response MUST NOT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2716 include entity information other than what can be considered as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2717 communication options (e.g., Allow is appropriate, but Content-Type
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2718 is not). Responses to this method are not cachable.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2719
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2720 If the Request-URI is an asterisk ("*"), the OPTIONS request is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2721 intended to apply to the server as a whole. A 200 response SHOULD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2722 include any header fields which indicate optional features
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2723 implemented by the server (e.g., Public), including any extensions
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2724 not defined by this specification, in addition to any applicable
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2725 general or response-header fields. As described in section 5.1.2, an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2726 "OPTIONS *" request can be applied through a proxy by specifying the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2727 destination server in the Request-URI without any path information.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2728
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2729 If the Request-URI is not an asterisk, the OPTIONS request applies
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2730 only to the options that are available when communicating with that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2731 resource. A 200 response SHOULD include any header fields which
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2732 indicate optional features implemented by the server and applicable
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2733 to that resource (e.g., Allow), including any extensions not defined
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2734 by this specification, in addition to any applicable general or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2735 response-header fields. If the OPTIONS request passes through a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2736 proxy, the proxy MUST edit the response to exclude those options
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2737 which apply to a proxy's capabilities and which are known to be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2738 unavailable through that proxy.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2739
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2740
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2741
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2742
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2743
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2744
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2745
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2746 Fielding, et. al. Standards Track [Page 49]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2747
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2748 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2749
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2750
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2751 9.3 GET
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2752
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2753 The GET method means retrieve whatever information (in the form of an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2754 entity) is identified by the Request-URI. If the Request-URI refers
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2755 to a data-producing process, it is the produced data which shall be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2756 returned as the entity in the response and not the source text of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2757 process, unless that text happens to be the output of the process.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2758
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2759 The semantics of the GET method change to a "conditional GET" if the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2760 request message includes an If-Modified-Since, If-Unmodified-Since,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2761 If-Match, If-None-Match, or If-Range header field. A conditional GET
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2762 method requests that the entity be transferred only under the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2763 circumstances described by the conditional header field(s). The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2764 conditional GET method is intended to reduce unnecessary network
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2765 usage by allowing cached entities to be refreshed without requiring
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2766 multiple requests or transferring data already held by the client.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2767
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2768 The semantics of the GET method change to a "partial GET" if the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2769 request message includes a Range header field. A partial GET requests
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2770 that only part of the entity be transferred, as described in section
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2771 14.36. The partial GET method is intended to reduce unnecessary
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2772 network usage by allowing partially-retrieved entities to be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2773 completed without transferring data already held by the client.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2774
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2775 The response to a GET request is cachable if and only if it meets the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2776 requirements for HTTP caching described in section 13.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2777
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2778 9.4 HEAD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2779
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2780 The HEAD method is identical to GET except that the server MUST NOT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2781 return a message-body in the response. The metainformation contained
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2782 in the HTTP headers in response to a HEAD request SHOULD be identical
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2783 to the information sent in response to a GET request. This method can
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2784 be used for obtaining metainformation about the entity implied by the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2785 request without transferring the entity-body itself. This method is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2786 often used for testing hypertext links for validity, accessibility,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2787 and recent modification.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2788
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2789 The response to a HEAD request may be cachable in the sense that the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2790 information contained in the response may be used to update a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2791 previously cached entity from that resource. If the new field values
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2792 indicate that the cached entity differs from the current entity (as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2793 would be indicated by a change in Content-Length, Content-MD5, ETag
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2794 or Last-Modified), then the cache MUST treat the cache entry as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2795 stale.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2796
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2797
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2798
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2799
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2800
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2801
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2802 Fielding, et. al. Standards Track [Page 50]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2803
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2804 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2805
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2806
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2807 9.5 POST
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2808
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2809 The POST method is used to request that the destination server accept
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2810 the entity enclosed in the request as a new subordinate of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2811 resource identified by the Request-URI in the Request-Line. POST is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2812 designed to allow a uniform method to cover the following functions:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2813
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2814 o Annotation of existing resources;
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2815
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2816 o Posting a message to a bulletin board, newsgroup, mailing list,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2817 or similar group of articles;
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2818
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2819 o Providing a block of data, such as the result of submitting a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2820 form, to a data-handling process;
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2821
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2822 o Extending a database through an append operation.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2823
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2824 The actual function performed by the POST method is determined by the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2825 server and is usually dependent on the Request-URI. The posted entity
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2826 is subordinate to that URI in the same way that a file is subordinate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2827 to a directory containing it, a news article is subordinate to a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2828 newsgroup to which it is posted, or a record is subordinate to a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2829 database.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2830
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2831 The action performed by the POST method might not result in a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2832 resource that can be identified by a URI. In this case, either 200
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2833 (OK) or 204 (No Content) is the appropriate response status,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2834 depending on whether or not the response includes an entity that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2835 describes the result.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2836
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2837 If a resource has been created on the origin server, the response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2838 SHOULD be 201 (Created) and contain an entity which describes the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2839 status of the request and refers to the new resource, and a Location
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2840 header (see section 14.30).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2841
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2842 Responses to this method are not cachable, unless the response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2843 includes appropriate Cache-Control or Expires header fields. However,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2844 the 303 (See Other) response can be used to direct the user agent to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2845 retrieve a cachable resource.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2846
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2847 POST requests must obey the message transmission requirements set out
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2848 in section 8.2.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2849
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2850
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2851
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2852
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2853
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2854
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2855
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2856
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2857
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2858 Fielding, et. al. Standards Track [Page 51]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2859
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2860 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2861
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2862
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2863 9.6 PUT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2864
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2865 The PUT method requests that the enclosed entity be stored under the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2866 supplied Request-URI. If the Request-URI refers to an already
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2867 existing resource, the enclosed entity SHOULD be considered as a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2868 modified version of the one residing on the origin server. If the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2869 Request-URI does not point to an existing resource, and that URI is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2870 capable of being defined as a new resource by the requesting user
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2871 agent, the origin server can create the resource with that URI. If a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2872 new resource is created, the origin server MUST inform the user agent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2873 via the 201 (Created) response. If an existing resource is modified,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2874 either the 200 (OK) or 204 (No Content) response codes SHOULD be sent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2875 to indicate successful completion of the request. If the resource
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2876 could not be created or modified with the Request-URI, an appropriate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2877 error response SHOULD be given that reflects the nature of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2878 problem. The recipient of the entity MUST NOT ignore any Content-*
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2879 (e.g. Content-Range) headers that it does not understand or implement
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2880 and MUST return a 501 (Not Implemented) response in such cases.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2881
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2882 If the request passes through a cache and the Request-URI identifies
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2883 one or more currently cached entities, those entries should be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2884 treated as stale. Responses to this method are not cachable.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2885
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2886 The fundamental difference between the POST and PUT requests is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2887 reflected in the different meaning of the Request-URI. The URI in a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2888 POST request identifies the resource that will handle the enclosed
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2889 entity. That resource may be a data-accepting process, a gateway to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2890 some other protocol, or a separate entity that accepts annotations.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2891 In contrast, the URI in a PUT request identifies the entity enclosed
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2892 with the request -- the user agent knows what URI is intended and the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2893 server MUST NOT attempt to apply the request to some other resource.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2894 If the server desires that the request be applied to a different URI,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2895 it MUST send a 301 (Moved Permanently) response; the user agent MAY
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2896 then make its own decision regarding whether or not to redirect the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2897 request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2898
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2899 A single resource MAY be identified by many different URIs. For
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2900 example, an article may have a URI for identifying "the current
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2901 version" which is separate from the URI identifying each particular
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2902 version. In this case, a PUT request on a general URI may result in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2903 several other URIs being defined by the origin server.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2904
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2905 HTTP/1.1 does not define how a PUT method affects the state of an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2906 origin server.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2907
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2908 PUT requests must obey the message transmission requirements set out
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2909 in section 8.2.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2910
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2911
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2912
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2913
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2914 Fielding, et. al. Standards Track [Page 52]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2915
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2916 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2917
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2918
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2919 9.7 DELETE
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2920
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2921 The DELETE method requests that the origin server delete the resource
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2922 identified by the Request-URI. This method MAY be overridden by human
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2923 intervention (or other means) on the origin server. The client cannot
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2924 be guaranteed that the operation has been carried out, even if the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2925 status code returned from the origin server indicates that the action
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2926 has been completed successfully. However, the server SHOULD not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2927 indicate success unless, at the time the response is given, it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2928 intends to delete the resource or move it to an inaccessible
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2929 location.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2930
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2931 A successful response SHOULD be 200 (OK) if the response includes an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2932 entity describing the status, 202 (Accepted) if the action has not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2933 yet been enacted, or 204 (No Content) if the response is OK but does
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2934 not include an entity.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2935
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2936 If the request passes through a cache and the Request-URI identifies
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2937 one or more currently cached entities, those entries should be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2938 treated as stale. Responses to this method are not cachable.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2939
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2940 9.8 TRACE
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2941
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2942 The TRACE method is used to invoke a remote, application-layer loop-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2943 back of the request message. The final recipient of the request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2944 SHOULD reflect the message received back to the client as the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2945 entity-body of a 200 (OK) response. The final recipient is either the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2946 origin server or the first proxy or gateway to receive a Max-Forwards
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2947 value of zero (0) in the request (see section 14.31). A TRACE request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2948 MUST NOT include an entity.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2949
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2950 TRACE allows the client to see what is being received at the other
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2951 end of the request chain and use that data for testing or diagnostic
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2952 information. The value of the Via header field (section 14.44) is of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2953 particular interest, since it acts as a trace of the request chain.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2954 Use of the Max-Forwards header field allows the client to limit the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2955 length of the request chain, which is useful for testing a chain of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2956 proxies forwarding messages in an infinite loop.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2957
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2958 If successful, the response SHOULD contain the entire request message
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2959 in the entity-body, with a Content-Type of "message/http". Responses
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2960 to this method MUST NOT be cached.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2961
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2962 10 Status Code Definitions
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2963
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2964 Each Status-Code is described below, including a description of which
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2965 method(s) it can follow and any metainformation required in the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2966 response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2967
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2968
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2969
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2970 Fielding, et. al. Standards Track [Page 53]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2971
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2972 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2973
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2974
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2975 10.1 Informational 1xx
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2976
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2977 This class of status code indicates a provisional response,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2978 consisting only of the Status-Line and optional headers, and is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2979 terminated by an empty line. Since HTTP/1.0 did not define any 1xx
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2980 status codes, servers MUST NOT send a 1xx response to an HTTP/1.0
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2981 client except under experimental conditions.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2982
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2983 10.1.1 100 Continue
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2984
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2985 The client may continue with its request. This interim response is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2986 used to inform the client that the initial part of the request has
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2987 been received and has not yet been rejected by the server. The client
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2988 SHOULD continue by sending the remainder of the request or, if the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2989 request has already been completed, ignore this response. The server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2990 MUST send a final response after the request has been completed.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2991
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2992 10.1.2 101 Switching Protocols
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2993
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2994 The server understands and is willing to comply with the client's
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2995 request, via the Upgrade message header field (section 14.41), for a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2996 change in the application protocol being used on this connection. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2997 server will switch protocols to those defined by the response's
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2998 Upgrade header field immediately after the empty line which
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2999 terminates the 101 response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3000
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3001 The protocol should only be switched when it is advantageous to do
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3002 so. For example, switching to a newer version of HTTP is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3003 advantageous over older versions, and switching to a real-time,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3004 synchronous protocol may be advantageous when delivering resources
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3005 that use such features.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3006
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3007 10.2 Successful 2xx
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3008
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3009 This class of status code indicates that the client's request was
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3010 successfully received, understood, and accepted.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3011
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3012 10.2.1 200 OK
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3013
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3014 The request has succeeded. The information returned with the response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3015 is dependent on the method used in the request, for example:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3016
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3017 GET an entity corresponding to the requested resource is sent in the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3018 response;
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3019
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3020 HEAD the entity-header fields corresponding to the requested resource
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3021 are sent in the response without any message-body;
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3022
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3023
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3024
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3025
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3026 Fielding, et. al. Standards Track [Page 54]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3027
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3028 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3029
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3030
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3031 POST an entity describing or containing the result of the action;
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3032
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3033 TRACE an entity containing the request message as received by the end
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3034 server.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3035
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3036 10.2.2 201 Created
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3037
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3038 The request has been fulfilled and resulted in a new resource being
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3039 created. The newly created resource can be referenced by the URI(s)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3040 returned in the entity of the response, with the most specific URL
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3041 for the resource given by a Location header field. The origin server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3042 MUST create the resource before returning the 201 status code. If the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3043 action cannot be carried out immediately, the server should respond
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3044 with 202 (Accepted) response instead.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3045
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3046 10.2.3 202 Accepted
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3047
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3048 The request has been accepted for processing, but the processing has
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3049 not been completed. The request MAY or MAY NOT eventually be acted
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3050 upon, as it MAY be disallowed when processing actually takes place.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3051 There is no facility for re-sending a status code from an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3052 asynchronous operation such as this.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3053
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3054 The 202 response is intentionally non-committal. Its purpose is to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3055 allow a server to accept a request for some other process (perhaps a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3056 batch-oriented process that is only run once per day) without
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3057 requiring that the user agent's connection to the server persist
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3058 until the process is completed. The entity returned with this
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3059 response SHOULD include an indication of the request's current status
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3060 and either a pointer to a status monitor or some estimate of when the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3061 user can expect the request to be fulfilled.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3062
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3063 10.2.4 203 Non-Authoritative Information
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3064
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3065 The returned metainformation in the entity-header is not the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3066 definitive set as available from the origin server, but is gathered
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3067 from a local or a third-party copy. The set presented MAY be a subset
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3068 or superset of the original version. For example, including local
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3069 annotation information about the resource MAY result in a superset of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3070 the metainformation known by the origin server. Use of this response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3071 code is not required and is only appropriate when the response would
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3072 otherwise be 200 (OK).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3073
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3074 10.2.5 204 No Content
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3075
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3076 The server has fulfilled the request but there is no new information
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3077 to send back. If the client is a user agent, it SHOULD NOT change its
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3078 document view from that which caused the request to be sent. This
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3079
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3080
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3081
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3082 Fielding, et. al. Standards Track [Page 55]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3083
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3084 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3085
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3086
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3087 response is primarily intended to allow input for actions to take
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3088 place without causing a change to the user agent's active document
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3089 view. The response MAY include new metainformation in the form of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3090 entity-headers, which SHOULD apply to the document currently in the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3091 user agent's active view.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3092
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3093 The 204 response MUST NOT include a message-body, and thus is always
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3094 terminated by the first empty line after the header fields.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3095
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3096 10.2.6 205 Reset Content
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3097
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3098 The server has fulfilled the request and the user agent SHOULD reset
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3099 the document view which caused the request to be sent. This response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3100 is primarily intended to allow input for actions to take place via
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3101 user input, followed by a clearing of the form in which the input is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3102 given so that the user can easily initiate another input action. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3103 response MUST NOT include an entity.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3104
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3105 10.2.7 206 Partial Content
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3106
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3107 The server has fulfilled the partial GET request for the resource.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3108 The request must have included a Range header field (section 14.36)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3109 indicating the desired range. The response MUST include either a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3110 Content-Range header field (section 14.17) indicating the range
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3111 included with this response, or a multipart/byteranges Content-Type
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3112 including Content-Range fields for each part. If multipart/byteranges
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3113 is not used, the Content-Length header field in the response MUST
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3114 match the actual number of OCTETs transmitted in the message-body.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3115
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3116 A cache that does not support the Range and Content-Range headers
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3117 MUST NOT cache 206 (Partial) responses.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3118
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3119 10.3 Redirection 3xx
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3120
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3121 This class of status code indicates that further action needs to be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3122 taken by the user agent in order to fulfill the request. The action
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3123 required MAY be carried out by the user agent without interaction
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3124 with the user if and only if the method used in the second request is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3125 GET or HEAD. A user agent SHOULD NOT automatically redirect a request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3126 more than 5 times, since such redirections usually indicate an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3127 infinite loop.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3128
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3129
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3130
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3131
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3132
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3133
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3134
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3135
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3136
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3137
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3138 Fielding, et. al. Standards Track [Page 56]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3139
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3140 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3141
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3142
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3143 10.3.1 300 Multiple Choices
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3144
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3145 The requested resource corresponds to any one of a set of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3146 representations, each with its own specific location, and agent-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3147 driven negotiation information (section 12) is being provided so that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3148 the user (or user agent) can select a preferred representation and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3149 redirect its request to that location.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3150
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3151 Unless it was a HEAD request, the response SHOULD include an entity
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3152 containing a list of resource characteristics and location(s) from
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3153 which the user or user agent can choose the one most appropriate. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3154 entity format is specified by the media type given in the Content-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3155 Type header field. Depending upon the format and the capabilities of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3156 the user agent, selection of the most appropriate choice may be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3157 performed automatically. However, this specification does not define
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3158 any standard for such automatic selection.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3159
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3160 If the server has a preferred choice of representation, it SHOULD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3161 include the specific URL for that representation in the Location
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3162 field; user agents MAY use the Location field value for automatic
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3163 redirection. This response is cachable unless indicated otherwise.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3164
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3165 10.3.2 301 Moved Permanently
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3166
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3167 The requested resource has been assigned a new permanent URI and any
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3168 future references to this resource SHOULD be done using one of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3169 returned URIs. Clients with link editing capabilities SHOULD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3170 automatically re-link references to the Request-URI to one or more of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3171 the new references returned by the server, where possible. This
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3172 response is cachable unless indicated otherwise.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3173
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3174 If the new URI is a location, its URL SHOULD be given by the Location
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3175 field in the response. Unless the request method was HEAD, the entity
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3176 of the response SHOULD contain a short hypertext note with a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3177 hyperlink to the new URI(s).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3178
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3179 If the 301 status code is received in response to a request other
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3180 than GET or HEAD, the user agent MUST NOT automatically redirect the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3181 request unless it can be confirmed by the user, since this might
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3182 change the conditions under which the request was issued.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3183
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3184 Note: When automatically redirecting a POST request after receiving
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3185 a 301 status code, some existing HTTP/1.0 user agents will
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3186 erroneously change it into a GET request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3187
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3188
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3189
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3190
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3191
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3192
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3193
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3194 Fielding, et. al. Standards Track [Page 57]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3195
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3196 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3197
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3198
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3199 10.3.3 302 Moved Temporarily
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3200
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3201 The requested resource resides temporarily under a different URI.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3202 Since the redirection may be altered on occasion, the client SHOULD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3203 continue to use the Request-URI for future requests. This response is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3204 only cachable if indicated by a Cache-Control or Expires header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3205 field.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3206
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3207 If the new URI is a location, its URL SHOULD be given by the Location
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3208 field in the response. Unless the request method was HEAD, the entity
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3209 of the response SHOULD contain a short hypertext note with a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3210 hyperlink to the new URI(s).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3211
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3212 If the 302 status code is received in response to a request other
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3213 than GET or HEAD, the user agent MUST NOT automatically redirect the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3214 request unless it can be confirmed by the user, since this might
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3215 change the conditions under which the request was issued.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3216
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3217 Note: When automatically redirecting a POST request after receiving
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3218 a 302 status code, some existing HTTP/1.0 user agents will
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3219 erroneously change it into a GET request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3220
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3221 10.3.4 303 See Other
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3222
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3223 The response to the request can be found under a different URI and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3224 SHOULD be retrieved using a GET method on that resource. This method
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3225 exists primarily to allow the output of a POST-activated script to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3226 redirect the user agent to a selected resource. The new URI is not a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3227 substitute reference for the originally requested resource. The 303
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3228 response is not cachable, but the response to the second (redirected)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3229 request MAY be cachable.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3230
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3231 If the new URI is a location, its URL SHOULD be given by the Location
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3232 field in the response. Unless the request method was HEAD, the entity
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3233 of the response SHOULD contain a short hypertext note with a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3234 hyperlink to the new URI(s).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3235
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3236 10.3.5 304 Not Modified
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3237
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3238 If the client has performed a conditional GET request and access is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3239 allowed, but the document has not been modified, the server SHOULD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3240 respond with this status code. The response MUST NOT contain a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3241 message-body.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3242
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3243
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3244
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3245
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3246
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3247
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3248
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3249
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3250 Fielding, et. al. Standards Track [Page 58]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3251
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3252 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3253
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3254
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3255 The response MUST include the following header fields:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3256
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3257 o Date
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3258
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3259 o ETag and/or Content-Location, if the header would have been sent in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3260 a 200 response to the same request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3261
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3262 o Expires, Cache-Control, and/or Vary, if the field-value might
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3263 differ from that sent in any previous response for the same variant
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3264
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3265 If the conditional GET used a strong cache validator (see section
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3266 13.3.3), the response SHOULD NOT include other entity-headers.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3267 Otherwise (i.e., the conditional GET used a weak validator), the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3268 response MUST NOT include other entity-headers; this prevents
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3269 inconsistencies between cached entity-bodies and updated headers.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3270
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3271 If a 304 response indicates an entity not currently cached, then the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3272 cache MUST disregard the response and repeat the request without the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3273 conditional.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3274
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3275 If a cache uses a received 304 response to update a cache entry, the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3276 cache MUST update the entry to reflect any new field values given in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3277 the response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3278
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3279 The 304 response MUST NOT include a message-body, and thus is always
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3280 terminated by the first empty line after the header fields.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3281
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3282 10.3.6 305 Use Proxy
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3283
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3284 The requested resource MUST be accessed through the proxy given by
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3285 the Location field. The Location field gives the URL of the proxy.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3286 The recipient is expected to repeat the request via the proxy.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3287
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3288 10.4 Client Error 4xx
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3289
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3290 The 4xx class of status code is intended for cases in which the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3291 client seems to have erred. Except when responding to a HEAD request,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3292 the server SHOULD include an entity containing an explanation of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3293 error situation, and whether it is a temporary or permanent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3294 condition. These status codes are applicable to any request method.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3295 User agents SHOULD display any included entity to the user.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3296
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3297 Note: If the client is sending data, a server implementation using
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3298 TCP should be careful to ensure that the client acknowledges
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3299 receipt of the packet(s) containing the response, before the server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3300 closes the input connection. If the client continues sending data
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3301 to the server after the close, the server's TCP stack will send a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3302 reset packet to the client, which may erase the client's
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3303
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3304
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3305
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3306 Fielding, et. al. Standards Track [Page 59]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3307
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3308 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3309
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3310
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3311 unacknowledged input buffers before they can be read and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3312 interpreted by the HTTP application.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3313
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3314 10.4.1 400 Bad Request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3315
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3316 The request could not be understood by the server due to malformed
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3317 syntax. The client SHOULD NOT repeat the request without
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3318 modifications.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3319
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3320 10.4.2 401 Unauthorized
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3321
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3322 The request requires user authentication. The response MUST include a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3323 WWW-Authenticate header field (section 14.46) containing a challenge
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3324 applicable to the requested resource. The client MAY repeat the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3325 request with a suitable Authorization header field (section 14.8). If
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3326 the request already included Authorization credentials, then the 401
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3327 response indicates that authorization has been refused for those
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3328 credentials. If the 401 response contains the same challenge as the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3329 prior response, and the user agent has already attempted
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3330 authentication at least once, then the user SHOULD be presented the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3331 entity that was given in the response, since that entity MAY include
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3332 relevant diagnostic information. HTTP access authentication is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3333 explained in section 11.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3334
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3335 10.4.3 402 Payment Required
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3336
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3337 This code is reserved for future use.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3338
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3339 10.4.4 403 Forbidden
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3340
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3341 The server understood the request, but is refusing to fulfill it.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3342 Authorization will not help and the request SHOULD NOT be repeated.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3343 If the request method was not HEAD and the server wishes to make
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3344 public why the request has not been fulfilled, it SHOULD describe the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3345 reason for the refusal in the entity. This status code is commonly
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3346 used when the server does not wish to reveal exactly why the request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3347 has been refused, or when no other response is applicable.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3348
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3349 10.4.5 404 Not Found
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3350
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3351 The server has not found anything matching the Request-URI. No
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3352 indication is given of whether the condition is temporary or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3353 permanent.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3354
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3355
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3356
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3357
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3358
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3359
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3360
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3361
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3362 Fielding, et. al. Standards Track [Page 60]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3363
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3364 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3365
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3366
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3367 If the server does not wish to make this information available to the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3368 client, the status code 403 (Forbidden) can be used instead. The 410
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3369 (Gone) status code SHOULD be used if the server knows, through some
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3370 internally configurable mechanism, that an old resource is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3371 permanently unavailable and has no forwarding address.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3372
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3373 10.4.6 405 Method Not Allowed
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3374
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3375 The method specified in the Request-Line is not allowed for the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3376 resource identified by the Request-URI. The response MUST include an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3377 Allow header containing a list of valid methods for the requested
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3378 resource.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3379
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3380 10.4.7 406 Not Acceptable
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3381
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3382 The resource identified by the request is only capable of generating
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3383 response entities which have content characteristics not acceptable
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3384 according to the accept headers sent in the request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3385
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3386 Unless it was a HEAD request, the response SHOULD include an entity
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3387 containing a list of available entity characteristics and location(s)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3388 from which the user or user agent can choose the one most
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3389 appropriate. The entity format is specified by the media type given
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3390 in the Content-Type header field. Depending upon the format and the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3391 capabilities of the user agent, selection of the most appropriate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3392 choice may be performed automatically. However, this specification
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3393 does not define any standard for such automatic selection.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3394
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3395 Note: HTTP/1.1 servers are allowed to return responses which are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3396 not acceptable according to the accept headers sent in the request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3397 In some cases, this may even be preferable to sending a 406
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3398 response. User agents are encouraged to inspect the headers of an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3399 incoming response to determine if it is acceptable. If the response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3400 could be unacceptable, a user agent SHOULD temporarily stop receipt
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3401 of more data and query the user for a decision on further actions.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3402
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3403 10.4.8 407 Proxy Authentication Required
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3404
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3405 This code is similar to 401 (Unauthorized), but indicates that the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3406 client MUST first authenticate itself with the proxy. The proxy MUST
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3407 return a Proxy-Authenticate header field (section 14.33) containing a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3408 challenge applicable to the proxy for the requested resource. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3409 client MAY repeat the request with a suitable Proxy-Authorization
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3410 header field (section 14.34). HTTP access authentication is explained
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3411 in section 11.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3412
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3413
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3414
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3415
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3416
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3417
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3418 Fielding, et. al. Standards Track [Page 61]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3419
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3420 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3421
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3422
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3423 10.4.9 408 Request Timeout
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3424
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3425 The client did not produce a request within the time that the server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3426 was prepared to wait. The client MAY repeat the request without
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3427 modifications at any later time.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3428
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3429 10.4.10 409 Conflict
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3430
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3431 The request could not be completed due to a conflict with the current
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3432 state of the resource. This code is only allowed in situations where
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3433 it is expected that the user might be able to resolve the conflict
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3434 and resubmit the request. The response body SHOULD include enough
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3435 information for the user to recognize the source of the conflict.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3436 Ideally, the response entity would include enough information for the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3437 user or user agent to fix the problem; however, that may not be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3438 possible and is not required.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3439
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3440 Conflicts are most likely to occur in response to a PUT request. If
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3441 versioning is being used and the entity being PUT includes changes to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3442 a resource which conflict with those made by an earlier (third-party)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3443 request, the server MAY use the 409 response to indicate that it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3444 can't complete the request. In this case, the response entity SHOULD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3445 contain a list of the differences between the two versions in a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3446 format defined by the response Content-Type.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3447
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3448 10.4.11 410 Gone
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3449
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3450 The requested resource is no longer available at the server and no
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3451 forwarding address is known. This condition SHOULD be considered
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3452 permanent. Clients with link editing capabilities SHOULD delete
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3453 references to the Request-URI after user approval. If the server does
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3454 not know, or has no facility to determine, whether or not the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3455 condition is permanent, the status code 404 (Not Found) SHOULD be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3456 used instead. This response is cachable unless indicated otherwise.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3457
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3458 The 410 response is primarily intended to assist the task of web
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3459 maintenance by notifying the recipient that the resource is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3460 intentionally unavailable and that the server owners desire that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3461 remote links to that resource be removed. Such an event is common for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3462 limited-time, promotional services and for resources belonging to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3463 individuals no longer working at the server's site. It is not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3464 necessary to mark all permanently unavailable resources as "gone" or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3465 to keep the mark for any length of time -- that is left to the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3466 discretion of the server owner.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3467
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3468
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3469
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3470
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3471
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3472
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3473
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3474 Fielding, et. al. Standards Track [Page 62]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3475
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3476 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3477
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3478
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3479 10.4.12 411 Length Required
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3480
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3481 The server refuses to accept the request without a defined Content-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3482 Length. The client MAY repeat the request if it adds a valid
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3483 Content-Length header field containing the length of the message-body
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3484 in the request message.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3485
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3486 10.4.13 412 Precondition Failed
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3487
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3488 The precondition given in one or more of the request-header fields
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3489 evaluated to false when it was tested on the server. This response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3490 code allows the client to place preconditions on the current resource
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3491 metainformation (header field data) and thus prevent the requested
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3492 method from being applied to a resource other than the one intended.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3493
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3494 10.4.14 413 Request Entity Too Large
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3495
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3496 The server is refusing to process a request because the request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3497 entity is larger than the server is willing or able to process. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3498 server may close the connection to prevent the client from continuing
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3499 the request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3500
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3501 If the condition is temporary, the server SHOULD include a Retry-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3502 After header field to indicate that it is temporary and after what
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3503 time the client may try again.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3504
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3505 10.4.15 414 Request-URI Too Long
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3506
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3507 The server is refusing to service the request because the Request-URI
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3508 is longer than the server is willing to interpret. This rare
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3509 condition is only likely to occur when a client has improperly
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3510 converted a POST request to a GET request with long query
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3511 information, when the client has descended into a URL "black hole" of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3512 redirection (e.g., a redirected URL prefix that points to a suffix of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3513 itself), or when the server is under attack by a client attempting to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3514 exploit security holes present in some servers using fixed-length
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3515 buffers for reading or manipulating the Request-URI.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3516
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3517 10.4.16 415 Unsupported Media Type
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3518
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3519 The server is refusing to service the request because the entity of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3520 the request is in a format not supported by the requested resource
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3521 for the requested method.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3522
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3523
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3524
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3525
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3526
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3527
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3528
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3529
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3530 Fielding, et. al. Standards Track [Page 63]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3531
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3532 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3533
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3534
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3535 10.5 Server Error 5xx
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3536
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3537 Response status codes beginning with the digit "5" indicate cases in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3538 which the server is aware that it has erred or is incapable of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3539 performing the request. Except when responding to a HEAD request, the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3540 server SHOULD include an entity containing an explanation of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3541 error situation, and whether it is a temporary or permanent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3542 condition. User agents SHOULD display any included entity to the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3543 user. These response codes are applicable to any request method.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3544
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3545 10.5.1 500 Internal Server Error
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3546
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3547 The server encountered an unexpected condition which prevented it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3548 from fulfilling the request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3549
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3550 10.5.2 501 Not Implemented
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3551
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3552 The server does not support the functionality required to fulfill the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3553 request. This is the appropriate response when the server does not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3554 recognize the request method and is not capable of supporting it for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3555 any resource.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3556
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3557 10.5.3 502 Bad Gateway
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3558
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3559 The server, while acting as a gateway or proxy, received an invalid
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3560 response from the upstream server it accessed in attempting to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3561 fulfill the request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3562
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3563 10.5.4 503 Service Unavailable
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3564
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3565 The server is currently unable to handle the request due to a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3566 temporary overloading or maintenance of the server. The implication
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3567 is that this is a temporary condition which will be alleviated after
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3568 some delay. If known, the length of the delay may be indicated in a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3569 Retry-After header. If no Retry-After is given, the client SHOULD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3570 handle the response as it would for a 500 response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3571
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3572 Note: The existence of the 503 status code does not imply that a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3573 server must use it when becoming overloaded. Some servers may wish
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3574 to simply refuse the connection.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3575
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3576 10.5.5 504 Gateway Timeout
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3577
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3578 The server, while acting as a gateway or proxy, did not receive a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3579 timely response from the upstream server it accessed in attempting to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3580 complete the request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3581
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3582
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3583
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3584
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3585
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3586 Fielding, et. al. Standards Track [Page 64]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3587
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3588 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3589
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3590
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3591 10.5.6 505 HTTP Version Not Supported
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3592
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3593 The server does not support, or refuses to support, the HTTP protocol
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3594 version that was used in the request message. The server is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3595 indicating that it is unable or unwilling to complete the request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3596 using the same major version as the client, as described in section
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3597 3.1, other than with this error message. The response SHOULD contain
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3598 an entity describing why that version is not supported and what other
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3599 protocols are supported by that server.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3600
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3601 11 Access Authentication
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3602
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3603 HTTP provides a simple challenge-response authentication mechanism
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3604 which MAY be used by a server to challenge a client request and by a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3605 client to provide authentication information. It uses an extensible,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3606 case-insensitive token to identify the authentication scheme,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3607 followed by a comma-separated list of attribute-value pairs which
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3608 carry the parameters necessary for achieving authentication via that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3609 scheme.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3610
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3611 auth-scheme = token
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3612
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3613 auth-param = token "=" quoted-string
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3614
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3615 The 401 (Unauthorized) response message is used by an origin server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3616 to challenge the authorization of a user agent. This response MUST
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3617 include a WWW-Authenticate header field containing at least one
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3618 challenge applicable to the requested resource.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3619
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3620 challenge = auth-scheme 1*SP realm *( "," auth-param )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3621
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3622 realm = "realm" "=" realm-value
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3623 realm-value = quoted-string
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3624
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3625 The realm attribute (case-insensitive) is required for all
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3626 authentication schemes which issue a challenge. The realm value
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3627 (case-sensitive), in combination with the canonical root URL (see
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3628 section 5.1.2) of the server being accessed, defines the protection
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3629 space. These realms allow the protected resources on a server to be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3630 partitioned into a set of protection spaces, each with its own
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3631 authentication scheme and/or authorization database. The realm value
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3632 is a string, generally assigned by the origin server, which may have
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3633 additional semantics specific to the authentication scheme.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3634
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3635 A user agent that wishes to authenticate itself with a server--
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3636 usually, but not necessarily, after receiving a 401 or 411 response-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3637 -MAY do so by including an Authorization header field with the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3638 request. The Authorization field value consists of credentials
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3639
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3640
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3641
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3642 Fielding, et. al. Standards Track [Page 65]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3643
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3644 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3645
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3646
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3647 containing the authentication information of the user agent for the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3648 realm of the resource being requested.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3649
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3650 credentials = basic-credentials
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3651 | auth-scheme #auth-param
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3652
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3653 The domain over which credentials can be automatically applied by a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3654 user agent is determined by the protection space. If a prior request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3655 has been authorized, the same credentials MAY be reused for all other
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3656 requests within that protection space for a period of time determined
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3657 by the authentication scheme, parameters, and/or user preference.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3658 Unless otherwise defined by the authentication scheme, a single
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3659 protection space cannot extend outside the scope of its server.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3660
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3661 If the server does not wish to accept the credentials sent with a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3662 request, it SHOULD return a 401 (Unauthorized) response. The response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3663 MUST include a WWW-Authenticate header field containing the (possibly
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3664 new) challenge applicable to the requested resource and an entity
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3665 explaining the refusal.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3666
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3667 The HTTP protocol does not restrict applications to this simple
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3668 challenge-response mechanism for access authentication. Additional
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3669 mechanisms MAY be used, such as encryption at the transport level or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3670 via message encapsulation, and with additional header fields
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3671 specifying authentication information. However, these additional
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3672 mechanisms are not defined by this specification.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3673
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3674 Proxies MUST be completely transparent regarding user agent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3675 authentication. That is, they MUST forward the WWW-Authenticate and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3676 Authorization headers untouched, and follow the rules found in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3677 section 14.8.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3678
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3679 HTTP/1.1 allows a client to pass authentication information to and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3680 from a proxy via the Proxy-Authenticate and Proxy-Authorization
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3681 headers.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3682
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3683 11.1 Basic Authentication Scheme
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3684
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3685 The "basic" authentication scheme is based on the model that the user
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3686 agent must authenticate itself with a user-ID and a password for each
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3687 realm. The realm value should be considered an opaque string which
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3688 can only be compared for equality with other realms on that server.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3689 The server will service the request only if it can validate the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3690 user-ID and password for the protection space of the Request-URI.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3691 There are no optional authentication parameters.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3692
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3693
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3694
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3695
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3696
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3697
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3698 Fielding, et. al. Standards Track [Page 66]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3699
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3700 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3701
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3702
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3703 Upon receipt of an unauthorized request for a URI within the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3704 protection space, the server MAY respond with a challenge like the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3705 following:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3706
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3707 WWW-Authenticate: Basic realm="WallyWorld"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3708
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3709 where "WallyWorld" is the string assigned by the server to identify
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3710 the protection space of the Request-URI.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3711
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3712 To receive authorization, the client sends the userid and password,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3713 separated by a single colon (":") character, within a base64 encoded
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3714 string in the credentials.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3715
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3716 basic-credentials = "Basic" SP basic-cookie
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3717
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3718 basic-cookie = <base64 [7] encoding of user-pass,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3719 except not limited to 76 char/line>
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3720
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3721 user-pass = userid ":" password
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3722
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3723 userid = *<TEXT excluding ":">
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3724
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3725 password = *TEXT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3726
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3727 Userids might be case sensitive.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3728
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3729 If the user agent wishes to send the userid "Aladdin" and password
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3730 "open sesame", it would use the following header field:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3731
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3732 Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3733
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3734 See section 15 for security considerations associated with Basic
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3735 authentication.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3736
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3737 11.2 Digest Authentication Scheme
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3738
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3739 A digest authentication for HTTP is specified in RFC 2069 [32].
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3740
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3741 12 Content Negotiation
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3742
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3743 Most HTTP responses include an entity which contains information for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3744 interpretation by a human user. Naturally, it is desirable to supply
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3745 the user with the "best available" entity corresponding to the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3746 request. Unfortunately for servers and caches, not all users have
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3747 the same preferences for what is "best," and not all user agents are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3748 equally capable of rendering all entity types. For that reason, HTTP
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3749 has provisions for several mechanisms for "content negotiation" --
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3750 the process of selecting the best representation for a given response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3751
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3752
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3753
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3754 Fielding, et. al. Standards Track [Page 67]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3755
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3756 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3757
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3758
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3759 when there are multiple representations available.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3760
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3761 Note: This is not called "format negotiation" because the alternate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3762 representations may be of the same media type, but use different
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3763 capabilities of that type, be in different languages, etc.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3764
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3765 Any response containing an entity-body MAY be subject to negotiation,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3766 including error responses.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3767
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3768 There are two kinds of content negotiation which are possible in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3769 HTTP: server-driven and agent-driven negotiation. These two kinds of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3770 negotiation are orthogonal and thus may be used separately or in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3771 combination. One method of combination, referred to as transparent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3772 negotiation, occurs when a cache uses the agent-driven negotiation
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3773 information provided by the origin server in order to provide
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3774 server-driven negotiation for subsequent requests.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3775
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3776 12.1 Server-driven Negotiation
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3777
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3778 If the selection of the best representation for a response is made by
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3779 an algorithm located at the server, it is called server-driven
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3780 negotiation. Selection is based on the available representations of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3781 the response (the dimensions over which it can vary; e.g. language,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3782 content-coding, etc.) and the contents of particular header fields in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3783 the request message or on other information pertaining to the request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3784 (such as the network address of the client).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3785
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3786 Server-driven negotiation is advantageous when the algorithm for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3787 selecting from among the available representations is difficult to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3788 describe to the user agent, or when the server desires to send its
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3789 "best guess" to the client along with the first response (hoping to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3790 avoid the round-trip delay of a subsequent request if the "best
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3791 guess" is good enough for the user). In order to improve the server's
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3792 guess, the user agent MAY include request header fields (Accept,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3793 Accept-Language, Accept-Encoding, etc.) which describe its
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3794 preferences for such a response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3795
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3796 Server-driven negotiation has disadvantages:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3797
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3798 1. It is impossible for the server to accurately determine what might be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3799 "best" for any given user, since that would require complete
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3800 knowledge of both the capabilities of the user agent and the intended
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3801 use for the response (e.g., does the user want to view it on screen
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3802 or print it on paper?).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3803
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3804 2. Having the user agent describe its capabilities in every request can
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3805 be both very inefficient (given that only a small percentage of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3806 responses have multiple representations) and a potential violation of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3807
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3808
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3809
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3810 Fielding, et. al. Standards Track [Page 68]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3811
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3812 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3813
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3814
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3815 the user's privacy.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3816
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3817 3. It complicates the implementation of an origin server and the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3818 algorithms for generating responses to a request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3819
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3820 4. It may limit a public cache's ability to use the same response for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3821 multiple user's requests.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3822
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3823 HTTP/1.1 includes the following request-header fields for enabling
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3824 server-driven negotiation through description of user agent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3825 capabilities and user preferences: Accept (section 14.1), Accept-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3826 Charset (section 14.2), Accept-Encoding (section 14.3), Accept-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3827 Language (section 14.4), and User-Agent (section 14.42). However, an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3828 origin server is not limited to these dimensions and MAY vary the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3829 response based on any aspect of the request, including information
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3830 outside the request-header fields or within extension header fields
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3831 not defined by this specification.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3832
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3833 HTTP/1.1 origin servers MUST include an appropriate Vary header field
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3834 (section 14.43) in any cachable response based on server-driven
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3835 negotiation. The Vary header field describes the dimensions over
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3836 which the response might vary (i.e. the dimensions over which the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3837 origin server picks its "best guess" response from multiple
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3838 representations).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3839
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3840 HTTP/1.1 public caches MUST recognize the Vary header field when it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3841 is included in a response and obey the requirements described in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3842 section 13.6 that describes the interactions between caching and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3843 content negotiation.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3844
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3845 12.2 Agent-driven Negotiation
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3846
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3847 With agent-driven negotiation, selection of the best representation
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3848 for a response is performed by the user agent after receiving an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3849 initial response from the origin server. Selection is based on a list
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3850 of the available representations of the response included within the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3851 header fields (this specification reserves the field-name Alternates,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3852 as described in appendix 19.6.2.1) or entity-body of the initial
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3853 response, with each representation identified by its own URI.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3854 Selection from among the representations may be performed
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3855 automatically (if the user agent is capable of doing so) or manually
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3856 by the user selecting from a generated (possibly hypertext) menu.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3857
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3858 Agent-driven negotiation is advantageous when the response would vary
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3859 over commonly-used dimensions (such as type, language, or encoding),
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3860 when the origin server is unable to determine a user agent's
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3861 capabilities from examining the request, and generally when public
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3862 caches are used to distribute server load and reduce network usage.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3863
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3864
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3865
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3866 Fielding, et. al. Standards Track [Page 69]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3867
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3868 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3869
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3870
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3871 Agent-driven negotiation suffers from the disadvantage of needing a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3872 second request to obtain the best alternate representation. This
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3873 second request is only efficient when caching is used. In addition,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3874 this specification does not define any mechanism for supporting
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3875 automatic selection, though it also does not prevent any such
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3876 mechanism from being developed as an extension and used within
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3877 HTTP/1.1.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3878
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3879 HTTP/1.1 defines the 300 (Multiple Choices) and 406 (Not Acceptable)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3880 status codes for enabling agent-driven negotiation when the server is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3881 unwilling or unable to provide a varying response using server-driven
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3882 negotiation.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3883
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3884 12.3 Transparent Negotiation
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3885
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3886 Transparent negotiation is a combination of both server-driven and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3887 agent-driven negotiation. When a cache is supplied with a form of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3888 list of available representations of the response (as in agent-driven
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3889 negotiation) and the dimensions of variance are completely understood
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3890 by the cache, then the cache becomes capable of performing server-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3891 driven negotiation on behalf of the origin server for subsequent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3892 requests on that resource.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3893
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3894 Transparent negotiation has the advantage of distributing the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3895 negotiation work that would otherwise be required of the origin
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3896 server and also removing the second request delay of agent-driven
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3897 negotiation when the cache is able to correctly guess the right
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3898 response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3899
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3900 This specification does not define any mechanism for transparent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3901 negotiation, though it also does not prevent any such mechanism from
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3902 being developed as an extension and used within HTTP/1.1. An HTTP/1.1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3903 cache performing transparent negotiation MUST include a Vary header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3904 field in the response (defining the dimensions of its variance) if it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3905 is cachable to ensure correct interoperation with all HTTP/1.1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3906 clients. The agent-driven negotiation information supplied by the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3907 origin server SHOULD be included with the transparently negotiated
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3908 response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3909
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3910 13 Caching in HTTP
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3911
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3912 HTTP is typically used for distributed information systems, where
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3913 performance can be improved by the use of response caches. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3914 HTTP/1.1 protocol includes a number of elements intended to make
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3915 caching work as well as possible. Because these elements are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3916 inextricable from other aspects of the protocol, and because they
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3917 interact with each other, it is useful to describe the basic caching
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3918 design of HTTP separately from the detailed descriptions of methods,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3919
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3920
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3921
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3922 Fielding, et. al. Standards Track [Page 70]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3923
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3924 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3925
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3926
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3927 headers, response codes, etc.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3928
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3929 Caching would be useless if it did not significantly improve
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3930 performance. The goal of caching in HTTP/1.1 is to eliminate the need
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3931 to send requests in many cases, and to eliminate the need to send
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3932 full responses in many other cases. The former reduces the number of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3933 network round-trips required for many operations; we use an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3934 "expiration" mechanism for this purpose (see section 13.2). The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3935 latter reduces network bandwidth requirements; we use a "validation"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3936 mechanism for this purpose (see section 13.3).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3937
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3938 Requirements for performance, availability, and disconnected
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3939 operation require us to be able to relax the goal of semantic
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3940 transparency. The HTTP/1.1 protocol allows origin servers, caches,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3941 and clients to explicitly reduce transparency when necessary.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3942 However, because non-transparent operation may confuse non-expert
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3943 users, and may be incompatible with certain server applications (such
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3944 as those for ordering merchandise), the protocol requires that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3945 transparency be relaxed
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3946
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3947 o only by an explicit protocol-level request when relaxed by client
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3948 or origin server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3949
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3950 o only with an explicit warning to the end user when relaxed by cache
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3951 or client
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3952
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3953
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3954
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3955
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3956
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3957
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3958
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3959
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3960
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3961
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3962
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3963
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3964
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3965
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3966
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3967
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3968
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3969
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3970
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3971
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3972
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3973
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3974
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3975
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3976
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3977
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3978 Fielding, et. al. Standards Track [Page 71]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3979
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3980 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3981
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3982
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3983 Therefore, the HTTP/1.1 protocol provides these important elements:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3984
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3985 1. Protocol features that provide full semantic transparency when this
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3986 is required by all parties.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3987
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3988 2. Protocol features that allow an origin server or user agent to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3989 explicitly request and control non-transparent operation.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3990
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3991 3. Protocol features that allow a cache to attach warnings to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3992 responses that do not preserve the requested approximation of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3993 semantic transparency.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3994
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3995 A basic principle is that it must be possible for the clients to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3996 detect any potential relaxation of semantic transparency.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3998 Note: The server, cache, or client implementer may be faced with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3999 design decisions not explicitly discussed in this specification. If
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4000 a decision may affect semantic transparency, the implementer ought
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4001 to err on the side of maintaining transparency unless a careful and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4002 complete analysis shows significant benefits in breaking
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4003 transparency.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4004
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4005 13.1.1 Cache Correctness
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4006
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4007 A correct cache MUST respond to a request with the most up-to-date
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4008 response held by the cache that is appropriate to the request (see
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4009 sections 13.2.5, 13.2.6, and 13.12) which meets one of the following
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4010 conditions:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4011
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4012 1. It has been checked for equivalence with what the origin server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4013 would have returned by revalidating the response with the origin
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4014 server (section 13.3);
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4015
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4016 2. It is "fresh enough" (see section 13.2). In the default case, this
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4017 means it meets the least restrictive freshness requirement of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4018 client, server, and cache (see section 14.9); if the origin server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4019 so specifies, it is the freshness requirement of the origin server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4020 alone.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4021
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4022 3. It includes a warning if the freshness demand of the client or the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4023 origin server is violated (see section 13.1.5 and 14.45).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4024
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4025 4. It is an appropriate 304 (Not Modified), 305 (Proxy Redirect), or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4026 error (4xx or 5xx) response message.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4027
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4028 If the cache can not communicate with the origin server, then a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4029 correct cache SHOULD respond as above if the response can be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4030 correctly served from the cache; if not it MUST return an error or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4031
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4032
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4033
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4034 Fielding, et. al. Standards Track [Page 72]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4035
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4036 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4037
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4038
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4039 warning indicating that there was a communication failure.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4040
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4041 If a cache receives a response (either an entire response, or a 304
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4042 (Not Modified) response) that it would normally forward to the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4043 requesting client, and the received response is no longer fresh, the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4044 cache SHOULD forward it to the requesting client without adding a new
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4045 Warning (but without removing any existing Warning headers). A cache
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4046 SHOULD NOT attempt to revalidate a response simply because that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4047 response became stale in transit; this might lead to an infinite
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4048 loop. An user agent that receives a stale response without a Warning
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4049 MAY display a warning indication to the user.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4050
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4051 13.1.2 Warnings
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4052
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4053 Whenever a cache returns a response that is neither first-hand nor
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4054 "fresh enough" (in the sense of condition 2 in section 13.1.1), it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4055 must attach a warning to that effect, using a Warning response-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4056 header. This warning allows clients to take appropriate action.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4057
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4058 Warnings may be used for other purposes, both cache-related and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4059 otherwise. The use of a warning, rather than an error status code,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4060 distinguish these responses from true failures.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4061
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4062 Warnings are always cachable, because they never weaken the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4063 transparency of a response. This means that warnings can be passed to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4064 HTTP/1.0 caches without danger; such caches will simply pass the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4065 warning along as an entity-header in the response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4066
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4067 Warnings are assigned numbers between 0 and 99. This specification
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4068 defines the code numbers and meanings of each currently assigned
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4069 warnings, allowing a client or cache to take automated action in some
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4070 (but not all) cases.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4071
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4072 Warnings also carry a warning text. The text may be in any
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4073 appropriate natural language (perhaps based on the client's Accept
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4074 headers), and include an optional indication of what character set is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4075 used.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4076
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4077 Multiple warnings may be attached to a response (either by the origin
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4078 server or by a cache), including multiple warnings with the same code
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4079 number. For example, a server may provide the same warning with texts
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4080 in both English and Basque.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4081
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4082 When multiple warnings are attached to a response, it may not be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4083 practical or reasonable to display all of them to the user. This
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4084 version of HTTP does not specify strict priority rules for deciding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4085 which warnings to display and in what order, but does suggest some
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4086 heuristics.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4087
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4088
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4089
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4090 Fielding, et. al. Standards Track [Page 73]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4091
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4092 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4093
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4094
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4095 The Warning header and the currently defined warnings are described
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4096 in section 14.45.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4097
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4098 13.1.3 Cache-control Mechanisms
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4099
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4100 The basic cache mechanisms in HTTP/1.1 (server-specified expiration
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4101 times and validators) are implicit directives to caches. In some
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4102 cases, a server or client may need to provide explicit directives to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4103 the HTTP caches. We use the Cache-Control header for this purpose.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4104
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4105 The Cache-Control header allows a client or server to transmit a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4106 variety of directives in either requests or responses. These
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4107 directives typically override the default caching algorithms. As a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4108 general rule, if there is any apparent conflict between header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4109 values, the most restrictive interpretation should be applied (that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4110 is, the one that is most likely to preserve semantic transparency).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4111 However, in some cases, Cache-Control directives are explicitly
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4112 specified as weakening the approximation of semantic transparency
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4113 (for example, "max-stale" or "public").
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4114
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4115 The Cache-Control directives are described in detail in section 14.9.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4116
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4117 13.1.4 Explicit User Agent Warnings
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4118
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4119 Many user agents make it possible for users to override the basic
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4120 caching mechanisms. For example, the user agent may allow the user to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4121 specify that cached entities (even explicitly stale ones) are never
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4122 validated. Or the user agent might habitually add "Cache-Control:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4123 max-stale=3600" to every request. The user should have to explicitly
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4124 request either non-transparent behavior, or behavior that results in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4125 abnormally ineffective caching.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4126
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4127 If the user has overridden the basic caching mechanisms, the user
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4128 agent should explicitly indicate to the user whenever this results in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4129 the display of information that might not meet the server's
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4130 transparency requirements (in particular, if the displayed entity is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4131 known to be stale). Since the protocol normally allows the user agent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4132 to determine if responses are stale or not, this indication need only
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4133 be displayed when this actually happens. The indication need not be a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4134 dialog box; it could be an icon (for example, a picture of a rotting
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4135 fish) or some other visual indicator.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4136
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4137 If the user has overridden the caching mechanisms in a way that would
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4138 abnormally reduce the effectiveness of caches, the user agent should
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4139 continually display an indication (for example, a picture of currency
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4140 in flames) so that the user does not inadvertently consume excess
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4141 resources or suffer from excessive latency.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4142
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4143
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4144
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4145
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4146 Fielding, et. al. Standards Track [Page 74]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4147
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4148 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4149
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4150
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4151 13.1.5 Exceptions to the Rules and Warnings
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4152
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4153 In some cases, the operator of a cache may choose to configure it to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4154 return stale responses even when not requested by clients. This
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4155 decision should not be made lightly, but may be necessary for reasons
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4156 of availability or performance, especially when the cache is poorly
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4157 connected to the origin server. Whenever a cache returns a stale
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4158 response, it MUST mark it as such (using a Warning header). This
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4159 allows the client software to alert the user that there may be a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4160 potential problem.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4161
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4162 It also allows the user agent to take steps to obtain a first-hand or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4163 fresh response. For this reason, a cache SHOULD NOT return a stale
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4164 response if the client explicitly requests a first-hand or fresh one,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4165 unless it is impossible to comply for technical or policy reasons.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4166
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4167 13.1.6 Client-controlled Behavior
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4168
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4169 While the origin server (and to a lesser extent, intermediate caches,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4170 by their contribution to the age of a response) are the primary
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4171 source of expiration information, in some cases the client may need
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4172 to control a cache's decision about whether to return a cached
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4173 response without validating it. Clients do this using several
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4174 directives of the Cache-Control header.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4175
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4176 A client's request may specify the maximum age it is willing to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4177 accept of an unvalidated response; specifying a value of zero forces
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4178 the cache(s) to revalidate all responses. A client may also specify
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4179 the minimum time remaining before a response expires. Both of these
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4180 options increase constraints on the behavior of caches, and so cannot
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4181 further relax the cache's approximation of semantic transparency.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4182
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4183 A client may also specify that it will accept stale responses, up to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4184 some maximum amount of staleness. This loosens the constraints on the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4185 caches, and so may violate the origin server's specified constraints
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4186 on semantic transparency, but may be necessary to support
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4187 disconnected operation, or high availability in the face of poor
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4188 connectivity.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4189
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4190 13.2 Expiration Model
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4191
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4192 13.2.1 Server-Specified Expiration
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4193
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4194 HTTP caching works best when caches can entirely avoid making
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4195 requests to the origin server. The primary mechanism for avoiding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4196 requests is for an origin server to provide an explicit expiration
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4197 time in the future, indicating that a response may be used to satisfy
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4198 subsequent requests. In other words, a cache can return a fresh
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4199
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4200
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4201
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4202 Fielding, et. al. Standards Track [Page 75]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4203
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4204 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4205
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4206
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4207 response without first contacting the server.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4208
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4209 Our expectation is that servers will assign future explicit
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4210 expiration times to responses in the belief that the entity is not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4211 likely to change, in a semantically significant way, before the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4212 expiration time is reached. This normally preserves semantic
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4213 transparency, as long as the server's expiration times are carefully
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4214 chosen.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4215
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4216 The expiration mechanism applies only to responses taken from a cache
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4217 and not to first-hand responses forwarded immediately to the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4218 requesting client.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4219
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4220 If an origin server wishes to force a semantically transparent cache
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4221 to validate every request, it may assign an explicit expiration time
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4222 in the past. This means that the response is always stale, and so the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4223 cache SHOULD validate it before using it for subsequent requests. See
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4224 section 14.9.4 for a more restrictive way to force revalidation.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4225
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4226 If an origin server wishes to force any HTTP/1.1 cache, no matter how
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4227 it is configured, to validate every request, it should use the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4228 "must-revalidate" Cache-Control directive (see section 14.9).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4229
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4230 Servers specify explicit expiration times using either the Expires
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4231 header, or the max-age directive of the Cache-Control header.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4232
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4233 An expiration time cannot be used to force a user agent to refresh
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4234 its display or reload a resource; its semantics apply only to caching
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4235 mechanisms, and such mechanisms need only check a resource's
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4236 expiration status when a new request for that resource is initiated.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4237 See section 13.13 for explanation of the difference between caches
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4238 and history mechanisms.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4239
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4240 13.2.2 Heuristic Expiration
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4241
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4242 Since origin servers do not always provide explicit expiration times,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4243 HTTP caches typically assign heuristic expiration times, employing
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4244 algorithms that use other header values (such as the Last-Modified
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4245 time) to estimate a plausible expiration time. The HTTP/1.1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4246 specification does not provide specific algorithms, but does impose
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4247 worst-case constraints on their results. Since heuristic expiration
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4248 times may compromise semantic transparency, they should be used
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4249 cautiously, and we encourage origin servers to provide explicit
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4250 expiration times as much as possible.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4251
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4252
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4253
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4254
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4255
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4256
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4257
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4258 Fielding, et. al. Standards Track [Page 76]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4259
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4260 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4261
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4262
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4263 13.2.3 Age Calculations
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4264
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4265 In order to know if a cached entry is fresh, a cache needs to know if
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4266 its age exceeds its freshness lifetime. We discuss how to calculate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4267 the latter in section 13.2.4; this section describes how to calculate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4268 the age of a response or cache entry.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4269
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4270 In this discussion, we use the term "now" to mean "the current value
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4271 of the clock at the host performing the calculation." Hosts that use
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4272 HTTP, but especially hosts running origin servers and caches, should
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4273 use NTP [28] or some similar protocol to synchronize their clocks to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4274 a globally accurate time standard.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4275
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4276 Also note that HTTP/1.1 requires origin servers to send a Date header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4277 with every response, giving the time at which the response was
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4278 generated. We use the term "date_value" to denote the value of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4279 Date header, in a form appropriate for arithmetic operations.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4280
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4281 HTTP/1.1 uses the Age response-header to help convey age information
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4282 between caches. The Age header value is the sender's estimate of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4283 amount of time since the response was generated at the origin server.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4284 In the case of a cached response that has been revalidated with the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4285 origin server, the Age value is based on the time of revalidation,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4286 not of the original response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4287
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4288 In essence, the Age value is the sum of the time that the response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4289 has been resident in each of the caches along the path from the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4290 origin server, plus the amount of time it has been in transit along
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4291 network paths.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4292
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4293 We use the term "age_value" to denote the value of the Age header, in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4294 a form appropriate for arithmetic operations.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4295
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4296 A response's age can be calculated in two entirely independent ways:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4297
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4298 1. now minus date_value, if the local clock is reasonably well
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4299 synchronized to the origin server's clock. If the result is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4300 negative, the result is replaced by zero.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4301
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4302 2. age_value, if all of the caches along the response path
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4303 implement HTTP/1.1.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4304
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4305 Given that we have two independent ways to compute the age of a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4306 response when it is received, we can combine these as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4307
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4308 corrected_received_age = max(now - date_value, age_value)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4309
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4310 and as long as we have either nearly synchronized clocks or all-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4311
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4312
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4313
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4314 Fielding, et. al. Standards Track [Page 77]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4315
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4316 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4317
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4318
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4319 HTTP/1.1 paths, one gets a reliable (conservative) result.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4320
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4321 Note that this correction is applied at each HTTP/1.1 cache along the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4322 path, so that if there is an HTTP/1.0 cache in the path, the correct
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4323 received age is computed as long as the receiving cache's clock is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4324 nearly in sync. We don't need end-to-end clock synchronization
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4325 (although it is good to have), and there is no explicit clock
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4326 synchronization step.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4327
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4328 Because of network-imposed delays, some significant interval may pass
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4329 from the time that a server generates a response and the time it is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4330 received at the next outbound cache or client. If uncorrected, this
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4331 delay could result in improperly low ages.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4332
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4333 Because the request that resulted in the returned Age value must have
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4334 been initiated prior to that Age value's generation, we can correct
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4335 for delays imposed by the network by recording the time at which the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4336 request was initiated. Then, when an Age value is received, it MUST
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4337 be interpreted relative to the time the request was initiated, not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4338 the time that the response was received. This algorithm results in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4339 conservative behavior no matter how much delay is experienced. So, we
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4340 compute:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4341
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4342 corrected_initial_age = corrected_received_age
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4343 + (now - request_time)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4344
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4345 where "request_time" is the time (according to the local clock) when
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4346 the request that elicited this response was sent.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4347
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4348 Summary of age calculation algorithm, when a cache receives a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4349 response:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4350
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4351 /*
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4352 * age_value
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4353 * is the value of Age: header received by the cache with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4354 * this response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4355 * date_value
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4356 * is the value of the origin server's Date: header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4357 * request_time
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4358 * is the (local) time when the cache made the request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4359 * that resulted in this cached response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4360 * response_time
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4361 * is the (local) time when the cache received the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4362 * response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4363 * now
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4364 * is the current (local) time
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4365 */
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4366 apparent_age = max(0, response_time - date_value);
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4367
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4368
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4369
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4370 Fielding, et. al. Standards Track [Page 78]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4371
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4372 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4373
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4374
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4375 corrected_received_age = max(apparent_age, age_value);
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4376 response_delay = response_time - request_time;
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4377 corrected_initial_age = corrected_received_age + response_delay;
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4378 resident_time = now - response_time;
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4379 current_age = corrected_initial_age + resident_time;
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4380
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4381 When a cache sends a response, it must add to the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4382 corrected_initial_age the amount of time that the response was
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4383 resident locally. It must then transmit this total age, using the Age
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4384 header, to the next recipient cache.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4385
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4386 Note that a client cannot reliably tell that a response is first-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4387 hand, but the presence of an Age header indicates that a response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4388 is definitely not first-hand. Also, if the Date in a response is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4389 earlier than the client's local request time, the response is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4390 probably not first-hand (in the absence of serious clock skew).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4391
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4392 13.2.4 Expiration Calculations
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4393
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4394 In order to decide whether a response is fresh or stale, we need to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4395 compare its freshness lifetime to its age. The age is calculated as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4396 described in section 13.2.3; this section describes how to calculate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4397 the freshness lifetime, and to determine if a response has expired.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4398 In the discussion below, the values can be represented in any form
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4399 appropriate for arithmetic operations.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4400
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4401 We use the term "expires_value" to denote the value of the Expires
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4402 header. We use the term "max_age_value" to denote an appropriate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4403 value of the number of seconds carried by the max-age directive of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4404 the Cache-Control header in a response (see section 14.10.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4405
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4406 The max-age directive takes priority over Expires, so if max-age is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4407 present in a response, the calculation is simply:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4408
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4409 freshness_lifetime = max_age_value
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4410
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4411 Otherwise, if Expires is present in the response, the calculation is:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4412
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4413 freshness_lifetime = expires_value - date_value
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4414
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4415 Note that neither of these calculations is vulnerable to clock skew,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4416 since all of the information comes from the origin server.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4417
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4418 If neither Expires nor Cache-Control: max-age appears in the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4419 response, and the response does not include other restrictions on
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4420 caching, the cache MAY compute a freshness lifetime using a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4421 heuristic. If the value is greater than 24 hours, the cache must
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4422 attach Warning 13 to any response whose age is more than 24 hours if
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4423
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4424
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4425
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4426 Fielding, et. al. Standards Track [Page 79]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4427
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4428 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4429
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4430
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4431 such warning has not already been added.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4432
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4433 Also, if the response does have a Last-Modified time, the heuristic
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4434 expiration value SHOULD be no more than some fraction of the interval
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4435 since that time. A typical setting of this fraction might be 10%.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4436
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4437 The calculation to determine if a response has expired is quite
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4438 simple:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4439
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4440 response_is_fresh = (freshness_lifetime > current_age)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4441
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4442 13.2.5 Disambiguating Expiration Values
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4443
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4444 Because expiration values are assigned optimistically, it is possible
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4445 for two caches to contain fresh values for the same resource that are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4446 different.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4447
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4448 If a client performing a retrieval receives a non-first-hand response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4449 for a request that was already fresh in its own cache, and the Date
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4450 header in its existing cache entry is newer than the Date on the new
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4451 response, then the client MAY ignore the response. If so, it MAY
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4452 retry the request with a "Cache-Control: max-age=0" directive (see
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4453 section 14.9), to force a check with the origin server.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4454
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4455 If a cache has two fresh responses for the same representation with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4456 different validators, it MUST use the one with the more recent Date
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4457 header. This situation may arise because the cache is pooling
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4458 responses from other caches, or because a client has asked for a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4459 reload or a revalidation of an apparently fresh cache entry.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4460
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4461 13.2.6 Disambiguating Multiple Responses
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4462
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4463 Because a client may be receiving responses via multiple paths, so
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4464 that some responses flow through one set of caches and other
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4465 responses flow through a different set of caches, a client may
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4466 receive responses in an order different from that in which the origin
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4467 server sent them. We would like the client to use the most recently
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4468 generated response, even if older responses are still apparently
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4469 fresh.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4470
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4471 Neither the entity tag nor the expiration value can impose an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4472 ordering on responses, since it is possible that a later response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4473 intentionally carries an earlier expiration time. However, the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4474 HTTP/1.1 specification requires the transmission of Date headers on
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4475 every response, and the Date values are ordered to a granularity of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4476 one second.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4477
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4478
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4479
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4480
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4481
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4482 Fielding, et. al. Standards Track [Page 80]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4483
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4484 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4485
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4486
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4487 When a client tries to revalidate a cache entry, and the response it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4488 receives contains a Date header that appears to be older than the one
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4489 for the existing entry, then the client SHOULD repeat the request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4490 unconditionally, and include
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4491
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4492 Cache-Control: max-age=0
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4493
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4494 to force any intermediate caches to validate their copies directly
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4495 with the origin server, or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4496
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4497 Cache-Control: no-cache
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4498
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4499 to force any intermediate caches to obtain a new copy from the origin
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4500 server.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4501
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4502 If the Date values are equal, then the client may use either response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4503 (or may, if it is being extremely prudent, request a new response).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4504 Servers MUST NOT depend on clients being able to choose
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4505 deterministically between responses generated during the same second,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4506 if their expiration times overlap.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4507
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4508 13.3 Validation Model
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4509
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4510 When a cache has a stale entry that it would like to use as a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4511 response to a client's request, it first has to check with the origin
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4512 server (or possibly an intermediate cache with a fresh response) to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4513 see if its cached entry is still usable. We call this "validating"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4514 the cache entry. Since we do not want to have to pay the overhead of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4515 retransmitting the full response if the cached entry is good, and we
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4516 do not want to pay the overhead of an extra round trip if the cached
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4517 entry is invalid, the HTTP/1.1 protocol supports the use of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4518 conditional methods.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4519
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4520 The key protocol features for supporting conditional methods are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4521 those concerned with "cache validators." When an origin server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4522 generates a full response, it attaches some sort of validator to it,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4523 which is kept with the cache entry. When a client (user agent or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4524 proxy cache) makes a conditional request for a resource for which it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4525 has a cache entry, it includes the associated validator in the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4526 request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4527
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4528 The server then checks that validator against the current validator
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4529 for the entity, and, if they match, it responds with a special status
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4530 code (usually, 304 (Not Modified)) and no entity-body. Otherwise, it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4531 returns a full response (including entity-body). Thus, we avoid
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4532 transmitting the full response if the validator matches, and we avoid
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4533 an extra round trip if it does not match.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4534
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4535
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4536
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4537
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4538 Fielding, et. al. Standards Track [Page 81]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4539
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4540 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4541
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4542
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4543 Note: the comparison functions used to decide if validators match
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4544 are defined in section 13.3.3.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4545
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4546 In HTTP/1.1, a conditional request looks exactly the same as a normal
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4547 request for the same resource, except that it carries a special
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4548 header (which includes the validator) that implicitly turns the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4549 method (usually, GET) into a conditional.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4550
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4551 The protocol includes both positive and negative senses of cache-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4552 validating conditions. That is, it is possible to request either that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4553 a method be performed if and only if a validator matches or if and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4554 only if no validators match.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4555
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4556 Note: a response that lacks a validator may still be cached, and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4557 served from cache until it expires, unless this is explicitly
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4558 prohibited by a Cache-Control directive. However, a cache cannot do
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4559 a conditional retrieval if it does not have a validator for the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4560 entity, which means it will not be refreshable after it expires.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4561
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4562 13.3.1 Last-modified Dates
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4563
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4564 The Last-Modified entity-header field value is often used as a cache
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4565 validator. In simple terms, a cache entry is considered to be valid
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4566 if the entity has not been modified since the Last-Modified value.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4567
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4568 13.3.2 Entity Tag Cache Validators
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4569
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4570 The ETag entity-header field value, an entity tag, provides for an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4571 "opaque" cache validator. This may allow more reliable validation in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4572 situations where it is inconvenient to store modification dates,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4573 where the one-second resolution of HTTP date values is not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4574 sufficient, or where the origin server wishes to avoid certain
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4575 paradoxes that may arise from the use of modification dates.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4576
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4577 Entity Tags are described in section 3.11. The headers used with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4578 entity tags are described in sections 14.20, 14.25, 14.26 and 14.43.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4579
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4580 13.3.3 Weak and Strong Validators
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4581
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4582 Since both origin servers and caches will compare two validators to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4583 decide if they represent the same or different entities, one normally
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4584 would expect that if the entity (the entity-body or any entity-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4585 headers) changes in any way, then the associated validator would
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4586 change as well. If this is true, then we call this validator a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4587 "strong validator."
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4588
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4589 However, there may be cases when a server prefers to change the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4590 validator only on semantically significant changes, and not when
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4591
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4592
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4593
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4594 Fielding, et. al. Standards Track [Page 82]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4595
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4596 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4597
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4598
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4599 insignificant aspects of the entity change. A validator that does not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4600 always change when the resource changes is a "weak validator."
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4601
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4602 Entity tags are normally "strong validators," but the protocol
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4603 provides a mechanism to tag an entity tag as "weak." One can think of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4604 a strong validator as one that changes whenever the bits of an entity
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4605 changes, while a weak value changes whenever the meaning of an entity
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4606 changes. Alternatively, one can think of a strong validator as part
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4607 of an identifier for a specific entity, while a weak validator is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4608 part of an identifier for a set of semantically equivalent entities.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4609
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4610 Note: One example of a strong validator is an integer that is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4611 incremented in stable storage every time an entity is changed.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4612
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4613 An entity's modification time, if represented with one-second
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4614 resolution, could be a weak validator, since it is possible that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4615 the resource may be modified twice during a single second.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4616
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4617 Support for weak validators is optional; however, weak validators
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4618 allow for more efficient caching of equivalent objects; for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4619 example, a hit counter on a site is probably good enough if it is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4620 updated every few days or weeks, and any value during that period
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4621 is likely "good enough" to be equivalent.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4622
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4623 A "use" of a validator is either when a client generates a request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4624 and includes the validator in a validating header field, or when a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4625 server compares two validators.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4626
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4627 Strong validators are usable in any context. Weak validators are only
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4628 usable in contexts that do not depend on exact equality of an entity.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4629 For example, either kind is usable for a conditional GET of a full
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4630 entity. However, only a strong validator is usable for a sub-range
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4631 retrieval, since otherwise the client may end up with an internally
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4632 inconsistent entity.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4633
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4634 The only function that the HTTP/1.1 protocol defines on validators is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4635 comparison. There are two validator comparison functions, depending
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4636 on whether the comparison context allows the use of weak validators
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4637 or not:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4638
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4639 o The strong comparison function: in order to be considered equal,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4640 both validators must be identical in every way, and neither may be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4641 weak.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4642 o The weak comparison function: in order to be considered equal, both
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4643 validators must be identical in every way, but either or both of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4644 them may be tagged as "weak" without affecting the result.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4645
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4646 The weak comparison function MAY be used for simple (non-subrange)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4647
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4648
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4649
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4650 Fielding, et. al. Standards Track [Page 83]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4651
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4652 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4653
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4654
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4655 GET requests. The strong comparison function MUST be used in all
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4656 other cases.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4657
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4658 An entity tag is strong unless it is explicitly tagged as weak.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4659 Section 3.11 gives the syntax for entity tags.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4660
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4661 A Last-Modified time, when used as a validator in a request, is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4662 implicitly weak unless it is possible to deduce that it is strong,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4663 using the following rules:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4664
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4665 o The validator is being compared by an origin server to the actual
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4666 current validator for the entity and,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4667 o That origin server reliably knows that the associated entity did
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4668 not change twice during the second covered by the presented
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4669 validator.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4670 or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4671
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4672 o The validator is about to be used by a client in an If-Modified-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4673 Since or If-Unmodified-Since header, because the client has a cache
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4674 entry for the associated entity, and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4675 o That cache entry includes a Date value, which gives the time when
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4676 the origin server sent the original response, and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4677 o The presented Last-Modified time is at least 60 seconds before the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4678 Date value.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4679 or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4680
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4681 o The validator is being compared by an intermediate cache to the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4682 validator stored in its cache entry for the entity, and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4683 o That cache entry includes a Date value, which gives the time when
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4684 the origin server sent the original response, and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4685 o The presented Last-Modified time is at least 60 seconds before the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4686 Date value.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4687
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4688 This method relies on the fact that if two different responses were
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4689 sent by the origin server during the same second, but both had the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4690 same Last-Modified time, then at least one of those responses would
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4691 have a Date value equal to its Last-Modified time. The arbitrary 60-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4692 second limit guards against the possibility that the Date and Last-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4693 Modified values are generated from different clocks, or at somewhat
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4694 different times during the preparation of the response. An
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4695 implementation may use a value larger than 60 seconds, if it is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4696 believed that 60 seconds is too short.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4697
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4698 If a client wishes to perform a sub-range retrieval on a value for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4699 which it has only a Last-Modified time and no opaque validator, it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4700 may do this only if the Last-Modified time is strong in the sense
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4701 described here.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4702
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4703
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4704
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4705
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4706 Fielding, et. al. Standards Track [Page 84]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4707
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4708 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4709
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4710
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4711 A cache or origin server receiving a cache-conditional request, other
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4712 than a full-body GET request, MUST use the strong comparison function
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4713 to evaluate the condition.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4714
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4715 These rules allow HTTP/1.1 caches and clients to safely perform sub-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4716 range retrievals on values that have been obtained from HTTP/1.0
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4717 servers.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4718
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4719 13.3.4 Rules for When to Use Entity Tags and Last-modified Dates
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4720
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4721 We adopt a set of rules and recommendations for origin servers,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4722 clients, and caches regarding when various validator types should be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4723 used, and for what purposes.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4724
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4725 HTTP/1.1 origin servers:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4726
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4727 o SHOULD send an entity tag validator unless it is not feasible to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4728 generate one.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4729 o MAY send a weak entity tag instead of a strong entity tag, if
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4730 performance considerations support the use of weak entity tags, or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4731 if it is unfeasible to send a strong entity tag.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4732 o SHOULD send a Last-Modified value if it is feasible to send one,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4733 unless the risk of a breakdown in semantic transparency that could
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4734 result from using this date in an If-Modified-Since header would
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4735 lead to serious problems.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4736
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4737 In other words, the preferred behavior for an HTTP/1.1 origin server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4738 is to send both a strong entity tag and a Last-Modified value.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4739
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4740 In order to be legal, a strong entity tag MUST change whenever the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4741 associated entity value changes in any way. A weak entity tag SHOULD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4742 change whenever the associated entity changes in a semantically
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4743 significant way.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4744
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4745 Note: in order to provide semantically transparent caching, an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4746 origin server must avoid reusing a specific strong entity tag value
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4747 for two different entities, or reusing a specific weak entity tag
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4748 value for two semantically different entities. Cache entries may
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4749 persist for arbitrarily long periods, regardless of expiration
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4750 times, so it may be inappropriate to expect that a cache will never
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4751 again attempt to validate an entry using a validator that it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4752 obtained at some point in the past.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4753
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4754 HTTP/1.1 clients:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4755
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4756 o If an entity tag has been provided by the origin server, MUST
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4757 use that entity tag in any cache-conditional request (using
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4758 If-Match or If-None-Match).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4759
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4760
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4761
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4762 Fielding, et. al. Standards Track [Page 85]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4763
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4764 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4765
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4766
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4767 o If only a Last-Modified value has been provided by the origin
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4768 server, SHOULD use that value in non-subrange cache-conditional
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4769 requests (using If-Modified-Since).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4770 o If only a Last-Modified value has been provided by an HTTP/1.0
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4771 origin server, MAY use that value in subrange cache-conditional
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4772 requests (using If-Unmodified-Since:). The user agent should
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4773 provide a way to disable this, in case of difficulty.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4774 o If both an entity tag and a Last-Modified value have been
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4775 provided by the origin server, SHOULD use both validators in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4776 cache-conditional requests. This allows both HTTP/1.0 and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4777 HTTP/1.1 caches to respond appropriately.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4778
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4779 An HTTP/1.1 cache, upon receiving a request, MUST use the most
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4780 restrictive validator when deciding whether the client's cache entry
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4781 matches the cache's own cache entry. This is only an issue when the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4782 request contains both an entity tag and a last-modified-date
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4783 validator (If-Modified-Since or If-Unmodified-Since).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4784
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4785 A note on rationale: The general principle behind these rules is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4786 that HTTP/1.1 servers and clients should transmit as much non-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4787 redundant information as is available in their responses and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4788 requests. HTTP/1.1 systems receiving this information will make the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4789 most conservative assumptions about the validators they receive.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4790
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4791 HTTP/1.0 clients and caches will ignore entity tags. Generally,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4792 last-modified values received or used by these systems will support
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4793 transparent and efficient caching, and so HTTP/1.1 origin servers
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4794 should provide Last-Modified values. In those rare cases where the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4795 use of a Last-Modified value as a validator by an HTTP/1.0 system
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4796 could result in a serious problem, then HTTP/1.1 origin servers
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4797 should not provide one.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4798
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4799 13.3.5 Non-validating Conditionals
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4800
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4801 The principle behind entity tags is that only the service author
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4802 knows the semantics of a resource well enough to select an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4803 appropriate cache validation mechanism, and the specification of any
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4804 validator comparison function more complex than byte-equality would
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4805 open up a can of worms. Thus, comparisons of any other headers
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4806 (except Last-Modified, for compatibility with HTTP/1.0) are never
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4807 used for purposes of validating a cache entry.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4808
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4809 13.4 Response Cachability
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4810
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4811 Unless specifically constrained by a Cache-Control (section 14.9)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4812 directive, a caching system may always store a successful response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4813 (see section 13.8) as a cache entry, may return it without validation
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4814 if it is fresh, and may return it after successful validation. If
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4815
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4816
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4817
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4818 Fielding, et. al. Standards Track [Page 86]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4819
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4820 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4821
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4822
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4823 there is neither a cache validator nor an explicit expiration time
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4824 associated with a response, we do not expect it to be cached, but
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4825 certain caches may violate this expectation (for example, when little
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4826 or no network connectivity is available). A client can usually detect
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4827 that such a response was taken from a cache by comparing the Date
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4828 header to the current time.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4829
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4830 Note that some HTTP/1.0 caches are known to violate this
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4831 expectation without providing any Warning.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4832
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4833 However, in some cases it may be inappropriate for a cache to retain
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4834 an entity, or to return it in response to a subsequent request. This
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4835 may be because absolute semantic transparency is deemed necessary by
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4836 the service author, or because of security or privacy considerations.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4837 Certain Cache-Control directives are therefore provided so that the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4838 server can indicate that certain resource entities, or portions
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4839 thereof, may not be cached regardless of other considerations.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4840
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4841 Note that section 14.8 normally prevents a shared cache from saving
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4842 and returning a response to a previous request if that request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4843 included an Authorization header.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4844
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4845 A response received with a status code of 200, 203, 206, 300, 301 or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4846 410 may be stored by a cache and used in reply to a subsequent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4847 request, subject to the expiration mechanism, unless a Cache-Control
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4848 directive prohibits caching. However, a cache that does not support
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4849 the Range and Content-Range headers MUST NOT cache 206 (Partial
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4850 Content) responses.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4851
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4852 A response received with any other status code MUST NOT be returned
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4853 in a reply to a subsequent request unless there are Cache-Control
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4854 directives or another header(s) that explicitly allow it. For
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4855 example, these include the following: an Expires header (section
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4856 14.21); a "max-age", "must-revalidate", "proxy-revalidate", "public"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4857 or "private" Cache-Control directive (section 14.9).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4858
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4859 13.5 Constructing Responses From Caches
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4860
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4861 The purpose of an HTTP cache is to store information received in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4862 response to requests, for use in responding to future requests. In
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4863 many cases, a cache simply returns the appropriate parts of a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4864 response to the requester. However, if the cache holds a cache entry
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4865 based on a previous response, it may have to combine parts of a new
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4866 response with what is held in the cache entry.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4867
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4868
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4869
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4870
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4871
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4872
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4873
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4874 Fielding, et. al. Standards Track [Page 87]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4875
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4876 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4877
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4878
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4879 13.5.1 End-to-end and Hop-by-hop Headers
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4880
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4881 For the purpose of defining the behavior of caches and non-caching
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4882 proxies, we divide HTTP headers into two categories:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4883
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4884 o End-to-end headers, which must be transmitted to the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4885 ultimate recipient of a request or response. End-to-end
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4886 headers in responses must be stored as part of a cache entry
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4887 and transmitted in any response formed from a cache entry.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4888 o Hop-by-hop headers, which are meaningful only for a single
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4889 transport-level connection, and are not stored by caches or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4890 forwarded by proxies.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4891
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4892 The following HTTP/1.1 headers are hop-by-hop headers:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4893
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4894 o Connection
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4895 o Keep-Alive
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4896 o Public
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4897 o Proxy-Authenticate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4898 o Transfer-Encoding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4899 o Upgrade
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4900
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4901 All other headers defined by HTTP/1.1 are end-to-end headers.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4902
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4903 Hop-by-hop headers introduced in future versions of HTTP MUST be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4904 listed in a Connection header, as described in section 14.10.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4905
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4906 13.5.2 Non-modifiable Headers
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4907
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4908 Some features of the HTTP/1.1 protocol, such as Digest
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4909 Authentication, depend on the value of certain end-to-end headers. A
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4910 cache or non-caching proxy SHOULD NOT modify an end-to-end header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4911 unless the definition of that header requires or specifically allows
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4912 that.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4913
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4914 A cache or non-caching proxy MUST NOT modify any of the following
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4915 fields in a request or response, nor may it add any of these fields
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4916 if not already present:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4917
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4918 o Content-Location
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4919 o ETag
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4920 o Expires
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4921 o Last-Modified
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4922
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4923
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4924
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4925
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4926
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4927
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4928
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4929
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4930 Fielding, et. al. Standards Track [Page 88]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4931
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4932 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4933
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4934
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4935 A cache or non-caching proxy MUST NOT modify or add any of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4936 following fields in a response that contains the no-transform Cache-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4937 Control directive, or in any request:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4938
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4939 o Content-Encoding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4940 o Content-Length
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4941 o Content-Range
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4942 o Content-Type
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4943
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4944 A cache or non-caching proxy MAY modify or add these fields in a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4945 response that does not include no-transform, but if it does so, it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4946 MUST add a Warning 14 (Transformation applied) if one does not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4947 already appear in the response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4948
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4949 Warning: unnecessary modification of end-to-end headers may cause
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4950 authentication failures if stronger authentication mechanisms are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4951 introduced in later versions of HTTP. Such authentication
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4952 mechanisms may rely on the values of header fields not listed here.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4953
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4954 13.5.3 Combining Headers
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4955
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4956 When a cache makes a validating request to a server, and the server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4957 provides a 304 (Not Modified) response, the cache must construct a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4958 response to send to the requesting client. The cache uses the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4959 entity-body stored in the cache entry as the entity-body of this
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4960 outgoing response. The end-to-end headers stored in the cache entry
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4961 are used for the constructed response, except that any end-to-end
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4962 headers provided in the 304 response MUST replace the corresponding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4963 headers from the cache entry. Unless the cache decides to remove the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4964 cache entry, it MUST also replace the end-to-end headers stored with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4965 the cache entry with corresponding headers received in the incoming
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4966 response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4967
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4968 In other words, the set of end-to-end headers received in the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4969 incoming response overrides all corresponding end-to-end headers
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4970 stored with the cache entry. The cache may add Warning headers (see
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4971 section 14.45) to this set.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4972
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4973 If a header field-name in the incoming response matches more than one
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4974 header in the cache entry, all such old headers are replaced.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4975
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4976 Note: this rule allows an origin server to use a 304 (Not Modified)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4977 response to update any header associated with a previous response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4978 for the same entity, although it might not always be meaningful or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4979 correct to do so. This rule does not allow an origin server to use
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4980 a 304 (not Modified) response to entirely delete a header that it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4981 had provided with a previous response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4982
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4983
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4984
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4985
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4986 Fielding, et. al. Standards Track [Page 89]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4987
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4988 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4989
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4990
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4991 13.5.4 Combining Byte Ranges
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4992
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4993 A response may transfer only a subrange of the bytes of an entity-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4994 body, either because the request included one or more Range
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4995 specifications, or because a connection was broken prematurely. After
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4996 several such transfers, a cache may have received several ranges of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4997 the same entity-body.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4998
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4999 If a cache has a stored non-empty set of subranges for an entity, and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5000 an incoming response transfers another subrange, the cache MAY
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5001 combine the new subrange with the existing set if both the following
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5002 conditions are met:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5003
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5004 o Both the incoming response and the cache entry must have a cache
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5005 validator.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5006 o The two cache validators must match using the strong comparison
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5007 function (see section 13.3.3).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5008
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5009 If either requirement is not meant, the cache must use only the most
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5010 recent partial response (based on the Date values transmitted with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5011 every response, and using the incoming response if these values are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5012 equal or missing), and must discard the other partial information.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5013
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5014 13.6 Caching Negotiated Responses
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5015
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5016 Use of server-driven content negotiation (section 12), as indicated
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5017 by the presence of a Vary header field in a response, alters the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5018 conditions and procedure by which a cache can use the response for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5019 subsequent requests.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5020
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5021 A server MUST use the Vary header field (section 14.43) to inform a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5022 cache of what header field dimensions are used to select among
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5023 multiple representations of a cachable response. A cache may use the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5024 selected representation (the entity included with that particular
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5025 response) for replying to subsequent requests on that resource only
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5026 when the subsequent requests have the same or equivalent values for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5027 all header fields specified in the Vary response-header. Requests
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5028 with a different value for one or more of those header fields would
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5029 be forwarded toward the origin server.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5030
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5031 If an entity tag was assigned to the representation, the forwarded
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5032 request SHOULD be conditional and include the entity tags in an If-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5033 None-Match header field from all its cache entries for the Request-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5034 URI. This conveys to the server the set of entities currently held by
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5035 the cache, so that if any one of these entities matches the requested
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5036 entity, the server can use the ETag header in its 304 (Not Modified)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5037 response to tell the cache which entry is appropriate. If the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5038 entity-tag of the new response matches that of an existing entry, the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5039
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5040
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5041
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5042 Fielding, et. al. Standards Track [Page 90]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5043
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5044 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5045
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5046
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5047 new response SHOULD be used to update the header fields of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5048 existing entry, and the result MUST be returned to the client.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5049
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5050 The Vary header field may also inform the cache that the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5051 representation was selected using criteria not limited to the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5052 request-headers; in this case, a cache MUST NOT use the response in a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5053 reply to a subsequent request unless the cache relays the new request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5054 to the origin server in a conditional request and the server responds
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5055 with 304 (Not Modified), including an entity tag or Content-Location
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5056 that indicates which entity should be used.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5057
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5058 If any of the existing cache entries contains only partial content
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5059 for the associated entity, its entity-tag SHOULD NOT be included in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5060 the If-None-Match header unless the request is for a range that would
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5061 be fully satisfied by that entry.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5062
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5063 If a cache receives a successful response whose Content-Location
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5064 field matches that of an existing cache entry for the same Request-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5065 URI, whose entity-tag differs from that of the existing entry, and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5066 whose Date is more recent than that of the existing entry, the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5067 existing entry SHOULD NOT be returned in response to future requests,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5068 and should be deleted from the cache.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5069
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5070 13.7 Shared and Non-Shared Caches
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5071
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5072 For reasons of security and privacy, it is necessary to make a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5073 distinction between "shared" and "non-shared" caches. A non-shared
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5074 cache is one that is accessible only to a single user. Accessibility
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5075 in this case SHOULD be enforced by appropriate security mechanisms.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5076 All other caches are considered to be "shared." Other sections of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5077 this specification place certain constraints on the operation of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5078 shared caches in order to prevent loss of privacy or failure of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5079 access controls.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5080
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5081 13.8 Errors or Incomplete Response Cache Behavior
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5082
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5083 A cache that receives an incomplete response (for example, with fewer
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5084 bytes of data than specified in a Content-Length header) may store
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5085 the response. However, the cache MUST treat this as a partial
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5086 response. Partial responses may be combined as described in section
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5087 13.5.4; the result might be a full response or might still be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5088 partial. A cache MUST NOT return a partial response to a client
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5089 without explicitly marking it as such, using the 206 (Partial
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5090 Content) status code. A cache MUST NOT return a partial response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5091 using a status code of 200 (OK).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5092
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5093 If a cache receives a 5xx response while attempting to revalidate an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5094 entry, it may either forward this response to the requesting client,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5095
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5096
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5097
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5098 Fielding, et. al. Standards Track [Page 91]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5099
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5100 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5101
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5102
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5103 or act as if the server failed to respond. In the latter case, it MAY
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5104 return a previously received response unless the cached entry
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5105 includes the "must-revalidate" Cache-Control directive (see section
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5106 14.9).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5107
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5108 13.9 Side Effects of GET and HEAD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5109
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5110 Unless the origin server explicitly prohibits the caching of their
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5111 responses, the application of GET and HEAD methods to any resources
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5112 SHOULD NOT have side effects that would lead to erroneous behavior if
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5113 these responses are taken from a cache. They may still have side
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5114 effects, but a cache is not required to consider such side effects in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5115 its caching decisions. Caches are always expected to observe an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5116 origin server's explicit restrictions on caching.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5117
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5118 We note one exception to this rule: since some applications have
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5119 traditionally used GETs and HEADs with query URLs (those containing a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5120 "?" in the rel_path part) to perform operations with significant side
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5121 effects, caches MUST NOT treat responses to such URLs as fresh unless
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5122 the server provides an explicit expiration time. This specifically
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5123 means that responses from HTTP/1.0 servers for such URIs should not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5124 be taken from a cache. See section 9.1.1 for related information.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5125
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5126 13.10 Invalidation After Updates or Deletions
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5127
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5128 The effect of certain methods at the origin server may cause one or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5129 more existing cache entries to become non-transparently invalid. That
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5130 is, although they may continue to be "fresh," they do not accurately
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5131 reflect what the origin server would return for a new request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5132
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5133 There is no way for the HTTP protocol to guarantee that all such
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5134 cache entries are marked invalid. For example, the request that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5135 caused the change at the origin server may not have gone through the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5136 proxy where a cache entry is stored. However, several rules help
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5137 reduce the likelihood of erroneous behavior.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5138
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5139 In this section, the phrase "invalidate an entity" means that the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5140 cache should either remove all instances of that entity from its
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5141 storage, or should mark these as "invalid" and in need of a mandatory
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5142 revalidation before they can be returned in response to a subsequent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5143 request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5144
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5145
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5146
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5147
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5148
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5149
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5150
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5151
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5152
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5153
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5154 Fielding, et. al. Standards Track [Page 92]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5155
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5156 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5157
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5158
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5159 Some HTTP methods may invalidate an entity. This is either the entity
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5160 referred to by the Request-URI, or by the Location or Content-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5161 Location response-headers (if present). These methods are:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5162
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5163 o PUT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5164 o DELETE
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5165 o POST
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5166
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5167 In order to prevent denial of service attacks, an invalidation based
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5168 on the URI in a Location or Content-Location header MUST only be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5169 performed if the host part is the same as in the Request-URI.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5170
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5171 13.11 Write-Through Mandatory
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5172
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5173 All methods that may be expected to cause modifications to the origin
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5174 server's resources MUST be written through to the origin server. This
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5175 currently includes all methods except for GET and HEAD. A cache MUST
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5176 NOT reply to such a request from a client before having transmitted
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5177 the request to the inbound server, and having received a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5178 corresponding response from the inbound server. This does not prevent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5179 a cache from sending a 100 (Continue) response before the inbound
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5180 server has replied.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5181
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5182 The alternative (known as "write-back" or "copy-back" caching) is not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5183 allowed in HTTP/1.1, due to the difficulty of providing consistent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5184 updates and the problems arising from server, cache, or network
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5185 failure prior to write-back.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5186
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5187 13.12 Cache Replacement
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5188
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5189 If a new cachable (see sections 14.9.2, 13.2.5, 13.2.6 and 13.8)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5190 response is received from a resource while any existing responses for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5191 the same resource are cached, the cache SHOULD use the new response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5192 to reply to the current request. It may insert it into cache storage
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5193 and may, if it meets all other requirements, use it to respond to any
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5194 future requests that would previously have caused the old response to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5195 be returned. If it inserts the new response into cache storage it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5196 should follow the rules in section 13.5.3.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5197
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5198 Note: a new response that has an older Date header value than
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5199 existing cached responses is not cachable.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5200
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5201 13.13 History Lists
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5202
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5203 User agents often have history mechanisms, such as "Back" buttons and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5204 history lists, which can be used to redisplay an entity retrieved
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5205 earlier in a session.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5206
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5207
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5208
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5209
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5210 Fielding, et. al. Standards Track [Page 93]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5211
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5212 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5213
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5214
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5215 History mechanisms and caches are different. In particular history
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5216 mechanisms SHOULD NOT try to show a semantically transparent view of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5217 the current state of a resource. Rather, a history mechanism is meant
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5218 to show exactly what the user saw at the time when the resource was
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5219 retrieved.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5220
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5221 By default, an expiration time does not apply to history mechanisms.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5222 If the entity is still in storage, a history mechanism should display
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5223 it even if the entity has expired, unless the user has specifically
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5224 configured the agent to refresh expired history documents.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5225
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5226 This should not be construed to prohibit the history mechanism from
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5227 telling the user that a view may be stale.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5228
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5229 Note: if history list mechanisms unnecessarily prevent users from
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5230 viewing stale resources, this will tend to force service authors to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5231 avoid using HTTP expiration controls and cache controls when they
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5232 would otherwise like to. Service authors may consider it important
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5233 that users not be presented with error messages or warning messages
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5234 when they use navigation controls (such as BACK) to view previously
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5235 fetched resources. Even though sometimes such resources ought not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5236 to cached, or ought to expire quickly, user interface
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5237 considerations may force service authors to resort to other means
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5238 of preventing caching (e.g. "once-only" URLs) in order not to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5239 suffer the effects of improperly functioning history mechanisms.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5240
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5241 14 Header Field Definitions
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5242
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5243 This section defines the syntax and semantics of all standard
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5244 HTTP/1.1 header fields. For entity-header fields, both sender and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5245 recipient refer to either the client or the server, depending on who
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5246 sends and who receives the entity.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5247
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5248
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5249
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5250
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5251
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5252
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5253
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5254
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5255
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5256
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5257
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5258
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5259
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5260
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5261
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5262
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5263
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5264
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5265
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5266 Fielding, et. al. Standards Track [Page 94]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5267
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5268 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5269
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5270
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5271 14.1 Accept
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5272
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5273 The Accept request-header field can be used to specify certain media
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5274 types which are acceptable for the response. Accept headers can be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5275 used to indicate that the request is specifically limited to a small
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5276 set of desired types, as in the case of a request for an in-line
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5277 image.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5278
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5279 Accept = "Accept" ":"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5280 #( media-range [ accept-params ] )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5281
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5282 media-range = ( "*/*"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5283 | ( type "/" "*" )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5284 | ( type "/" subtype )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5285 ) *( ";" parameter )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5286
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5287 accept-params = ";" "q" "=" qvalue *( accept-extension )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5288
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5289 accept-extension = ";" token [ "=" ( token | quoted-string ) ]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5290
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5291 The asterisk "*" character is used to group media types into ranges,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5292 with "*/*" indicating all media types and "type/*" indicating all
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5293 subtypes of that type. The media-range MAY include media type
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5294 parameters that are applicable to that range.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5295
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5296 Each media-range MAY be followed by one or more accept-params,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5297 beginning with the "q" parameter for indicating a relative quality
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5298 factor. The first "q" parameter (if any) separates the media-range
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5299 parameter(s) from the accept-params. Quality factors allow the user
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5300 or user agent to indicate the relative degree of preference for that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5301 media-range, using the qvalue scale from 0 to 1 (section 3.9). The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5302 default value is q=1.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5303
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5304 Note: Use of the "q" parameter name to separate media type
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5305 parameters from Accept extension parameters is due to historical
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5306 practice. Although this prevents any media type parameter named
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5307 "q" from being used with a media range, such an event is believed
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5308 to be unlikely given the lack of any "q" parameters in the IANA
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5309 media type registry and the rare usage of any media type parameters
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5310 in Accept. Future media types should be discouraged from
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5311 registering any parameter named "q".
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5312
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5313 The example
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5314
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5315 Accept: audio/*; q=0.2, audio/basic
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5316
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5317 SHOULD be interpreted as "I prefer audio/basic, but send me any audio
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5318 type if it is the best available after an 80% mark-down in quality."
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5319
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5320
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5321
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5322 Fielding, et. al. Standards Track [Page 95]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5323
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5324 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5325
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5326
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5327 If no Accept header field is present, then it is assumed that the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5328 client accepts all media types. If an Accept header field is present,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5329 and if the server cannot send a response which is acceptable
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5330 according to the combined Accept field value, then the server SHOULD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5331 send a 406 (not acceptable) response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5332
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5333 A more elaborate example is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5334
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5335 Accept: text/plain; q=0.5, text/html,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5336 text/x-dvi; q=0.8, text/x-c
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5337
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5338 Verbally, this would be interpreted as "text/html and text/x-c are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5339 the preferred media types, but if they do not exist, then send the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5340 text/x-dvi entity, and if that does not exist, send the text/plain
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5341 entity."
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5342
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5343 Media ranges can be overridden by more specific media ranges or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5344 specific media types. If more than one media range applies to a given
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5345 type, the most specific reference has precedence. For example,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5346
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5347 Accept: text/*, text/html, text/html;level=1, */*
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5348
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5349 have the following precedence:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5350
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5351 1) text/html;level=1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5352 2) text/html
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5353 3) text/*
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5354 4) */*
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5355
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5356 The media type quality factor associated with a given type is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5357 determined by finding the media range with the highest precedence
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5358 which matches that type. For example,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5359
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5360 Accept: text/*;q=0.3, text/html;q=0.7, text/html;level=1,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5361 text/html;level=2;q=0.4, */*;q=0.5
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5362
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5363 would cause the following values to be associated:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5364
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5365 text/html;level=1 = 1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5366 text/html = 0.7
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5367 text/plain = 0.3
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5368 image/jpeg = 0.5
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5369 text/html;level=2 = 0.4
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5370 text/html;level=3 = 0.7
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5371
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5372 Note: A user agent may be provided with a default set of quality
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5373 values for certain media ranges. However, unless the user agent is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5374 a closed system which cannot interact with other rendering agents,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5375
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5376
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5377
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5378 Fielding, et. al. Standards Track [Page 96]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5379
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5380 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5381
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5382
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5383 this default set should be configurable by the user.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5384
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5385 14.2 Accept-Charset
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5386
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5387 The Accept-Charset request-header field can be used to indicate what
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5388 character sets are acceptable for the response. This field allows
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5389 clients capable of understanding more comprehensive or special-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5390 purpose character sets to signal that capability to a server which is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5391 capable of representing documents in those character sets. The ISO-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5392 8859-1 character set can be assumed to be acceptable to all user
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5393 agents.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5394
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5395 Accept-Charset = "Accept-Charset" ":"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5396 1#( charset [ ";" "q" "=" qvalue ] )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5397
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5398 Character set values are described in section 3.4. Each charset may
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5399 be given an associated quality value which represents the user's
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5400 preference for that charset. The default value is q=1. An example is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5401
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5402 Accept-Charset: iso-8859-5, unicode-1-1;q=0.8
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5403
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5404 If no Accept-Charset header is present, the default is that any
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5405 character set is acceptable. If an Accept-Charset header is present,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5406 and if the server cannot send a response which is acceptable
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5407 according to the Accept-Charset header, then the server SHOULD send
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5408 an error response with the 406 (not acceptable) status code, though
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5409 the sending of an unacceptable response is also allowed.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5410
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5411 14.3 Accept-Encoding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5412
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5413 The Accept-Encoding request-header field is similar to Accept, but
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5414 restricts the content-coding values (section 14.12) which are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5415 acceptable in the response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5416
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5417 Accept-Encoding = "Accept-Encoding" ":"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5418 #( content-coding )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5419
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5420 An example of its use is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5421
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5422 Accept-Encoding: compress, gzip
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5423
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5424 If no Accept-Encoding header is present in a request, the server MAY
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5425 assume that the client will accept any content coding. If an Accept-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5426 Encoding header is present, and if the server cannot send a response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5427 which is acceptable according to the Accept-Encoding header, then the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5428 server SHOULD send an error response with the 406 (Not Acceptable)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5429 status code.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5430
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5431
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5432
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5433
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5434 Fielding, et. al. Standards Track [Page 97]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5435
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5436 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5437
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5438
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5439 An empty Accept-Encoding value indicates none are acceptable.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5440
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5441 14.4 Accept-Language
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5442
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5443 The Accept-Language request-header field is similar to Accept, but
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5444 restricts the set of natural languages that are preferred as a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5445 response to the request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5446
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5447 Accept-Language = "Accept-Language" ":"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5448 1#( language-range [ ";" "q" "=" qvalue ] )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5449
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5450 language-range = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5451
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5452 Each language-range MAY be given an associated quality value which
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5453 represents an estimate of the user's preference for the languages
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5454 specified by that range. The quality value defaults to "q=1". For
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5455 example,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5456
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5457 Accept-Language: da, en-gb;q=0.8, en;q=0.7
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5458
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5459 would mean: "I prefer Danish, but will accept British English and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5460 other types of English." A language-range matches a language-tag if
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5461 it exactly equals the tag, or if it exactly equals a prefix of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5462 tag such that the first tag character following the prefix is "-".
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5463 The special range "*", if present in the Accept-Language field,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5464 matches every tag not matched by any other range present in the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5465 Accept-Language field.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5466
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5467 Note: This use of a prefix matching rule does not imply that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5468 language tags are assigned to languages in such a way that it is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5469 always true that if a user understands a language with a certain
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5470 tag, then this user will also understand all languages with tags
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5471 for which this tag is a prefix. The prefix rule simply allows the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5472 use of prefix tags if this is the case.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5473
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5474 The language quality factor assigned to a language-tag by the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5475 Accept-Language field is the quality value of the longest language-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5476 range in the field that matches the language-tag. If no language-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5477 range in the field matches the tag, the language quality factor
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5478 assigned is 0. If no Accept-Language header is present in the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5479 request, the server SHOULD assume that all languages are equally
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5480 acceptable. If an Accept-Language header is present, then all
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5481 languages which are assigned a quality factor greater than 0 are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5482 acceptable.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5483
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5484 It may be contrary to the privacy expectations of the user to send an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5485 Accept-Language header with the complete linguistic preferences of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5486 the user in every request. For a discussion of this issue, see
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5487
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5488
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5489
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5490 Fielding, et. al. Standards Track [Page 98]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5491
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5492 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5493
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5494
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5495 section 15.7.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5496
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5497 Note: As intelligibility is highly dependent on the individual
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5498 user, it is recommended that client applications make the choice of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5499 linguistic preference available to the user. If the choice is not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5500 made available, then the Accept-Language header field must not be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5501 given in the request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5502
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5503 14.5 Accept-Ranges
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5504
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5505 The Accept-Ranges response-header field allows the server to indicate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5506 its acceptance of range requests for a resource:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5507
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5508 Accept-Ranges = "Accept-Ranges" ":" acceptable-ranges
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5509
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5510 acceptable-ranges = 1#range-unit | "none"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5511
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5512 Origin servers that accept byte-range requests MAY send
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5513
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5514 Accept-Ranges: bytes
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5515
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5516 but are not required to do so. Clients MAY generate byte-range
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5517 requests without having received this header for the resource
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5518 involved.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5519
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5520 Servers that do not accept any kind of range request for a resource
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5521 MAY send
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5522
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5523 Accept-Ranges: none
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5524
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5525 to advise the client not to attempt a range request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5526
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5527 14.6 Age
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5528
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5529 The Age response-header field conveys the sender's estimate of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5530 amount of time since the response (or its revalidation) was generated
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5531 at the origin server. A cached response is "fresh" if its age does
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5532 not exceed its freshness lifetime. Age values are calculated as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5533 specified in section 13.2.3.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5534
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5535 Age = "Age" ":" age-value
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5536
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5537 age-value = delta-seconds
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5538
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5539 Age values are non-negative decimal integers, representing time in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5540 seconds.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5541
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5542
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5543
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5544
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5545
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5546 Fielding, et. al. Standards Track [Page 99]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5547
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5548 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5549
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5550
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5551 If a cache receives a value larger than the largest positive integer
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5552 it can represent, or if any of its age calculations overflows, it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5553 MUST transmit an Age header with a value of 2147483648 (2^31).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5554 HTTP/1.1 caches MUST send an Age header in every response. Caches
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5555 SHOULD use an arithmetic type of at least 31 bits of range.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5556
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5557 14.7 Allow
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5558
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5559 The Allow entity-header field lists the set of methods supported by
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5560 the resource identified by the Request-URI. The purpose of this field
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5561 is strictly to inform the recipient of valid methods associated with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5562 the resource. An Allow header field MUST be present in a 405 (Method
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5563 Not Allowed) response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5564
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5565 Allow = "Allow" ":" 1#method
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5566
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5567 Example of use:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5568
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5569 Allow: GET, HEAD, PUT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5570
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5571 This field cannot prevent a client from trying other methods.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5572 However, the indications given by the Allow header field value SHOULD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5573 be followed. The actual set of allowed methods is defined by the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5574 origin server at the time of each request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5575
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5576 The Allow header field MAY be provided with a PUT request to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5577 recommend the methods to be supported by the new or modified
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5578 resource. The server is not required to support these methods and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5579 SHOULD include an Allow header in the response giving the actual
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5580 supported methods.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5581
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5582 A proxy MUST NOT modify the Allow header field even if it does not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5583 understand all the methods specified, since the user agent MAY have
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5584 other means of communicating with the origin server.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5585
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5586 The Allow header field does not indicate what methods are implemented
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5587 at the server level. Servers MAY use the Public response-header field
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5588 (section 14.35) to describe what methods are implemented on the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5589 server as a whole.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5590
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5591 14.8 Authorization
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5592
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5593 A user agent that wishes to authenticate itself with a server--
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5594 usually, but not necessarily, after receiving a 401 response--MAY do
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5595 so by including an Authorization request-header field with the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5596 request. The Authorization field value consists of credentials
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5597 containing the authentication information of the user agent for the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5598 realm of the resource being requested.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5599
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5600
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5601
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5602 Fielding, et. al. Standards Track [Page 100]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5603
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5604 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5605
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5606
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5607 Authorization = "Authorization" ":" credentials
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5608
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5609 HTTP access authentication is described in section 11. If a request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5610 is authenticated and a realm specified, the same credentials SHOULD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5611 be valid for all other requests within this realm.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5612
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5613 When a shared cache (see section 13.7) receives a request containing
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5614 an Authorization field, it MUST NOT return the corresponding response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5615 as a reply to any other request, unless one of the following specific
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5616 exceptions holds:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5617
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5618 1. If the response includes the "proxy-revalidate" Cache-Control
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5619 directive, the cache MAY use that response in replying to a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5620 subsequent request, but a proxy cache MUST first revalidate it with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5621 the origin server, using the request-headers from the new request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5622 to allow the origin server to authenticate the new request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5623 2. If the response includes the "must-revalidate" Cache-Control
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5624 directive, the cache MAY use that response in replying to a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5625 subsequent request, but all caches MUST first revalidate it with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5626 the origin server, using the request-headers from the new request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5627 to allow the origin server to authenticate the new request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5628 3. If the response includes the "public" Cache-Control directive, it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5629 may be returned in reply to any subsequent request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5630
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5631 14.9 Cache-Control
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5632
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5633 The Cache-Control general-header field is used to specify directives
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5634 that MUST be obeyed by all caching mechanisms along the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5635 request/response chain. The directives specify behavior intended to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5636 prevent caches from adversely interfering with the request or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5637 response. These directives typically override the default caching
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5638 algorithms. Cache directives are unidirectional in that the presence
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5639 of a directive in a request does not imply that the same directive
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5640 should be given in the response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5641
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5642 Note that HTTP/1.0 caches may not implement Cache-Control and may
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5643 only implement Pragma: no-cache (see section 14.32).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5644
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5645 Cache directives must be passed through by a proxy or gateway
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5646 application, regardless of their significance to that application,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5647 since the directives may be applicable to all recipients along the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5648 request/response chain. It is not possible to specify a cache-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5649 directive for a specific cache.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5650
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5651 Cache-Control = "Cache-Control" ":" 1#cache-directive
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5652
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5653 cache-directive = cache-request-directive
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5654 | cache-response-directive
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5655
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5656
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5657
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5658 Fielding, et. al. Standards Track [Page 101]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5659
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5660 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5661
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5662
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5663 cache-request-directive =
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5664 "no-cache" [ "=" <"> 1#field-name <"> ]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5665 | "no-store"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5666 | "max-age" "=" delta-seconds
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5667 | "max-stale" [ "=" delta-seconds ]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5668 | "min-fresh" "=" delta-seconds
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5669 | "only-if-cached"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5670 | cache-extension
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5671
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5672 cache-response-directive =
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5673 "public"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5674 | "private" [ "=" <"> 1#field-name <"> ]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5675 | "no-cache" [ "=" <"> 1#field-name <"> ]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5676 | "no-store"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5677 | "no-transform"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5678 | "must-revalidate"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5679 | "proxy-revalidate"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5680 | "max-age" "=" delta-seconds
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5681 | cache-extension
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5682
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5683 cache-extension = token [ "=" ( token | quoted-string ) ]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5684
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5685 When a directive appears without any 1#field-name parameter, the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5686 directive applies to the entire request or response. When such a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5687 directive appears with a 1#field-name parameter, it applies only to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5688 the named field or fields, and not to the rest of the request or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5689 response. This mechanism supports extensibility; implementations of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5690 future versions of the HTTP protocol may apply these directives to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5691 header fields not defined in HTTP/1.1.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5692
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5693 The cache-control directives can be broken down into these general
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5694 categories:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5695
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5696 o Restrictions on what is cachable; these may only be imposed by the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5697 origin server.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5698 o Restrictions on what may be stored by a cache; these may be imposed
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5699 by either the origin server or the user agent.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5700 o Modifications of the basic expiration mechanism; these may be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5701 imposed by either the origin server or the user agent.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5702 o Controls over cache revalidation and reload; these may only be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5703 imposed by a user agent.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5704 o Control over transformation of entities.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5705 o Extensions to the caching system.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5706
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5707
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5708
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5709
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5710
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5711
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5712
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5713
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5714 Fielding, et. al. Standards Track [Page 102]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5715
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5716 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5717
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5718
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5719 14.9.1 What is Cachable
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5720
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5721 By default, a response is cachable if the requirements of the request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5722 method, request header fields, and the response status indicate that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5723 it is cachable. Section 13.4 summarizes these defaults for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5724 cachability. The following Cache-Control response directives allow an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5725 origin server to override the default cachability of a response:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5726
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5727 public
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5728 Indicates that the response is cachable by any cache, even if it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5729 would normally be non-cachable or cachable only within a non-shared
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5730 cache. (See also Authorization, section 14.8, for additional
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5731 details.)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5732
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5733 private
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5734 Indicates that all or part of the response message is intended for a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5735 single user and MUST NOT be cached by a shared cache. This allows an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5736 origin server to state that the specified parts of the response are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5737 intended for only one user and are not a valid response for requests
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5738 by other users. A private (non-shared) cache may cache the response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5739
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5740 Note: This usage of the word private only controls where the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5741 response may be cached, and cannot ensure the privacy of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5742 message content.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5743
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5744 no-cache
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5745 Indicates that all or part of the response message MUST NOT be cached
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5746 anywhere. This allows an origin server to prevent caching even by
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5747 caches that have been configured to return stale responses to client
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5748 requests.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5749
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5750 Note: Most HTTP/1.0 caches will not recognize or obey this
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5751 directive.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5752
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5753 14.9.2 What May be Stored by Caches
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5754
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5755 The purpose of the no-store directive is to prevent the inadvertent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5756 release or retention of sensitive information (for example, on backup
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5757 tapes). The no-store directive applies to the entire message, and may
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5758 be sent either in a response or in a request. If sent in a request, a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5759 cache MUST NOT store any part of either this request or any response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5760 to it. If sent in a response, a cache MUST NOT store any part of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5761 either this response or the request that elicited it. This directive
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5762 applies to both non-shared and shared caches. "MUST NOT store" in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5763 this context means that the cache MUST NOT intentionally store the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5764 information in non-volatile storage, and MUST make a best-effort
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5765 attempt to remove the information from volatile storage as promptly
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5766 as possible after forwarding it.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5767
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5768
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5769
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5770 Fielding, et. al. Standards Track [Page 103]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5771
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5772 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5773
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5774
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5775 Even when this directive is associated with a response, users may
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5776 explicitly store such a response outside of the caching system (e.g.,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5777 with a "Save As" dialog). History buffers may store such responses as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5778 part of their normal operation.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5779
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5780 The purpose of this directive is to meet the stated requirements of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5781 certain users and service authors who are concerned about accidental
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5782 releases of information via unanticipated accesses to cache data
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5783 structures. While the use of this directive may improve privacy in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5784 some cases, we caution that it is NOT in any way a reliable or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5785 sufficient mechanism for ensuring privacy. In particular, malicious
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5786 or compromised caches may not recognize or obey this directive; and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5787 communications networks may be vulnerable to eavesdropping.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5788
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5789 14.9.3 Modifications of the Basic Expiration Mechanism
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5790
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5791 The expiration time of an entity may be specified by the origin
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5792 server using the Expires header (see section 14.21). Alternatively,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5793 it may be specified using the max-age directive in a response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5794
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5795 If a response includes both an Expires header and a max-age
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5796 directive, the max-age directive overrides the Expires header, even
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5797 if the Expires header is more restrictive. This rule allows an origin
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5798 server to provide, for a given response, a longer expiration time to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5799 an HTTP/1.1 (or later) cache than to an HTTP/1.0 cache. This may be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5800 useful if certain HTTP/1.0 caches improperly calculate ages or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5801 expiration times, perhaps due to desynchronized clocks.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5802
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5803 Note: most older caches, not compliant with this specification, do
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5804 not implement any Cache-Control directives. An origin server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5805 wishing to use a Cache-Control directive that restricts, but does
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5806 not prevent, caching by an HTTP/1.1-compliant cache may exploit the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5807 requirement that the max-age directive overrides the Expires
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5808 header, and the fact that non-HTTP/1.1-compliant caches do not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5809 observe the max-age directive.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5810
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5811 Other directives allow an user agent to modify the basic expiration
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5812 mechanism. These directives may be specified on a request:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5813
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5814 max-age
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5815 Indicates that the client is willing to accept a response whose age
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5816 is no greater than the specified time in seconds. Unless max-stale
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5817 directive is also included, the client is not willing to accept a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5818 stale response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5819
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5820 min-fresh
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5821 Indicates that the client is willing to accept a response whose
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5822 freshness lifetime is no less than its current age plus the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5823
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5824
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5825
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5826 Fielding, et. al. Standards Track [Page 104]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5827
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5828 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5829
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5830
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5831 specified time in seconds. That is, the client wants a response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5832 that will still be fresh for at least the specified number of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5833 seconds.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5834
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5835 max-stale
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5836 Indicates that the client is willing to accept a response that has
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5837 exceeded its expiration time. If max-stale is assigned a value,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5838 then the client is willing to accept a response that has exceeded
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5839 its expiration time by no more than the specified number of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5840 seconds. If no value is assigned to max-stale, then the client is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5841 willing to accept a stale response of any age.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5842
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5843 If a cache returns a stale response, either because of a max-stale
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5844 directive on a request, or because the cache is configured to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5845 override the expiration time of a response, the cache MUST attach a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5846 Warning header to the stale response, using Warning 10 (Response is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5847 stale).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5848
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5849 14.9.4 Cache Revalidation and Reload Controls
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5850
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5851 Sometimes an user agent may want or need to insist that a cache
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5852 revalidate its cache entry with the origin server (and not just with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5853 the next cache along the path to the origin server), or to reload its
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5854 cache entry from the origin server. End-to-end revalidation may be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5855 necessary if either the cache or the origin server has overestimated
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5856 the expiration time of the cached response. End-to-end reload may be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5857 necessary if the cache entry has become corrupted for some reason.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5858
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5859 End-to-end revalidation may be requested either when the client does
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5860 not have its own local cached copy, in which case we call it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5861 "unspecified end-to-end revalidation", or when the client does have a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5862 local cached copy, in which case we call it "specific end-to-end
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5863 revalidation."
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5864
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5865 The client can specify these three kinds of action using Cache-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5866 Control request directives:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5867
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5868 End-to-end reload
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5869 The request includes a "no-cache" Cache-Control directive or, for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5870 compatibility with HTTP/1.0 clients, "Pragma: no-cache". No field
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5871 names may be included with the no-cache directive in a request. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5872 server MUST NOT use a cached copy when responding to such a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5873 request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5874
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5875 Specific end-to-end revalidation
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5876 The request includes a "max-age=0" Cache-Control directive, which
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5877 forces each cache along the path to the origin server to revalidate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5878 its own entry, if any, with the next cache or server. The initial
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5879
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5880
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5881
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5882 Fielding, et. al. Standards Track [Page 105]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5883
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5884 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5885
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5886
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5887 request includes a cache-validating conditional with the client's
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5888 current validator.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5889
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5890 Unspecified end-to-end revalidation
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5891 The request includes "max-age=0" Cache-Control directive, which
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5892 forces each cache along the path to the origin server to revalidate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5893 its own entry, if any, with the next cache or server. The initial
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5894 request does not include a cache-validating conditional; the first
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5895 cache along the path (if any) that holds a cache entry for this
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5896 resource includes a cache-validating conditional with its current
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5897 validator.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5898
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5899 When an intermediate cache is forced, by means of a max-age=0
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5900 directive, to revalidate its own cache entry, and the client has
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5901 supplied its own validator in the request, the supplied validator may
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5902 differ from the validator currently stored with the cache entry. In
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5903 this case, the cache may use either validator in making its own
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5904 request without affecting semantic transparency.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5905
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5906 However, the choice of validator may affect performance. The best
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5907 approach is for the intermediate cache to use its own validator when
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5908 making its request. If the server replies with 304 (Not Modified),
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5909 then the cache should return its now validated copy to the client
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5910 with a 200 (OK) response. If the server replies with a new entity and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5911 cache validator, however, the intermediate cache should compare the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5912 returned validator with the one provided in the client's request,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5913 using the strong comparison function. If the client's validator is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5914 equal to the origin server's, then the intermediate cache simply
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5915 returns 304 (Not Modified). Otherwise, it returns the new entity with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5916 a 200 (OK) response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5917
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5918 If a request includes the no-cache directive, it should not include
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5919 min-fresh, max-stale, or max-age.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5920
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5921 In some cases, such as times of extremely poor network connectivity,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5922 a client may want a cache to return only those responses that it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5923 currently has stored, and not to reload or revalidate with the origin
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5924 server. To do this, the client may include the only-if-cached
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5925 directive in a request. If it receives this directive, a cache SHOULD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5926 either respond using a cached entry that is consistent with the other
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5927 constraints of the request, or respond with a 504 (Gateway Timeout)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5928 status. However, if a group of caches is being operated as a unified
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5929 system with good internal connectivity, such a request MAY be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5930 forwarded within that group of caches.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5931
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5932 Because a cache may be configured to ignore a server's specified
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5933 expiration time, and because a client request may include a max-stale
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5934 directive (which has a similar effect), the protocol also includes a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5935
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5936
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5937
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5938 Fielding, et. al. Standards Track [Page 106]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5939
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5940 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5941
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5942
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5943 mechanism for the origin server to require revalidation of a cache
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5944 entry on any subsequent use. When the must-revalidate directive is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5945 present in a response received by a cache, that cache MUST NOT use
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5946 the entry after it becomes stale to respond to a subsequent request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5947 without first revalidating it with the origin server. (I.e., the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5948 cache must do an end-to-end revalidation every time, if, based solely
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5949 on the origin server's Expires or max-age value, the cached response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5950 is stale.)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5951
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5952 The must-revalidate directive is necessary to support reliable
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5953 operation for certain protocol features. In all circumstances an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5954 HTTP/1.1 cache MUST obey the must-revalidate directive; in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5955 particular, if the cache cannot reach the origin server for any
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5956 reason, it MUST generate a 504 (Gateway Timeout) response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5957
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5958 Servers should send the must-revalidate directive if and only if
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5959 failure to revalidate a request on the entity could result in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5960 incorrect operation, such as a silently unexecuted financial
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5961 transaction. Recipients MUST NOT take any automated action that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5962 violates this directive, and MUST NOT automatically provide an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5963 unvalidated copy of the entity if revalidation fails.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5964
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5965 Although this is not recommended, user agents operating under severe
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5966 connectivity constraints may violate this directive but, if so, MUST
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5967 explicitly warn the user that an unvalidated response has been
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5968 provided. The warning MUST be provided on each unvalidated access,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5969 and SHOULD require explicit user confirmation.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5970
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5971 The proxy-revalidate directive has the same meaning as the must-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5972 revalidate directive, except that it does not apply to non-shared
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5973 user agent caches. It can be used on a response to an authenticated
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5974 request to permit the user's cache to store and later return the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5975 response without needing to revalidate it (since it has already been
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5976 authenticated once by that user), while still requiring proxies that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5977 service many users to revalidate each time (in order to make sure
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5978 that each user has been authenticated). Note that such authenticated
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5979 responses also need the public cache control directive in order to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5980 allow them to be cached at all.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5981
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5982 14.9.5 No-Transform Directive
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5983
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5984 Implementers of intermediate caches (proxies) have found it useful to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5985 convert the media type of certain entity bodies. A proxy might, for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5986 example, convert between image formats in order to save cache space
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5987 or to reduce the amount of traffic on a slow link. HTTP has to date
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5988 been silent on these transformations.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5989
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5990
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5991
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5992
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5993
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5994 Fielding, et. al. Standards Track [Page 107]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5995
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5996 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5998
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5999 Serious operational problems have already occurred, however, when
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6000 these transformations have been applied to entity bodies intended for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6001 certain kinds of applications. For example, applications for medical
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6002 imaging, scientific data analysis and those using end-to-end
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6003 authentication, all depend on receiving an entity body that is bit
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6004 for bit identical to the original entity-body.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6005
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6006 Therefore, if a response includes the no-transform directive, an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6007 intermediate cache or proxy MUST NOT change those headers that are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6008 listed in section 13.5.2 as being subject to the no-transform
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6009 directive. This implies that the cache or proxy must not change any
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6010 aspect of the entity-body that is specified by these headers.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6011
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6012 14.9.6 Cache Control Extensions
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6013
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6014 The Cache-Control header field can be extended through the use of one
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6015 or more cache-extension tokens, each with an optional assigned value.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6016 Informational extensions (those which do not require a change in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6017 cache behavior) may be added without changing the semantics of other
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6018 directives. Behavioral extensions are designed to work by acting as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6019 modifiers to the existing base of cache directives. Both the new
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6020 directive and the standard directive are supplied, such that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6021 applications which do not understand the new directive will default
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6022 to the behavior specified by the standard directive, and those that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6023 understand the new directive will recognize it as modifying the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6024 requirements associated with the standard directive. In this way,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6025 extensions to the Cache-Control directives can be made without
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6026 requiring changes to the base protocol.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6027
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6028 This extension mechanism depends on a HTTP cache obeying all of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6029 cache-control directives defined for its native HTTP-version, obeying
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6030 certain extensions, and ignoring all directives that it does not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6031 understand.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6032
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6033 For example, consider a hypothetical new response directive called
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6034 "community" which acts as a modifier to the "private" directive. We
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6035 define this new directive to mean that, in addition to any non-shared
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6036 cache, any cache which is shared only by members of the community
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6037 named within its value may cache the response. An origin server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6038 wishing to allow the "UCI" community to use an otherwise private
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6039 response in their shared cache(s) may do so by including
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6040
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6041 Cache-Control: private, community="UCI"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6042
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6043 A cache seeing this header field will act correctly even if the cache
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6044 does not understand the "community" cache-extension, since it will
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6045 also see and understand the "private" directive and thus default to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6046 the safe behavior.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6047
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6048
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6049
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6050 Fielding, et. al. Standards Track [Page 108]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6051
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6052 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6053
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6054
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6055 Unrecognized cache-directives MUST be ignored; it is assumed that any
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6056 cache-directive likely to be unrecognized by an HTTP/1.1 cache will
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6057 be combined with standard directives (or the response's default
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6058 cachability) such that the cache behavior will remain minimally
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6059 correct even if the cache does not understand the extension(s).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6060
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6061 14.10 Connection
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6062
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6063 The Connection general-header field allows the sender to specify
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6064 options that are desired for that particular connection and MUST NOT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6065 be communicated by proxies over further connections.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6066
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6067 The Connection header has the following grammar:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6068
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6069 Connection-header = "Connection" ":" 1#(connection-token)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6070 connection-token = token
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6071
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6072 HTTP/1.1 proxies MUST parse the Connection header field before a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6073 message is forwarded and, for each connection-token in this field,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6074 remove any header field(s) from the message with the same name as the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6075 connection-token. Connection options are signaled by the presence of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6076 a connection-token in the Connection header field, not by any
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6077 corresponding additional header field(s), since the additional header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6078 field may not be sent if there are no parameters associated with that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6079 connection option. HTTP/1.1 defines the "close" connection option
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6080 for the sender to signal that the connection will be closed after
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6081 completion of the response. For example,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6082
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6083 Connection: close
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6084
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6085 in either the request or the response header fields indicates that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6086 the connection should not be considered `persistent' (section 8.1)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6087 after the current request/response is complete.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6088
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6089 HTTP/1.1 applications that do not support persistent connections MUST
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6090 include the "close" connection option in every message.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6091
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6092 14.11 Content-Base
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6093
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6094 The Content-Base entity-header field may be used to specify the base
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6095 URI for resolving relative URLs within the entity. This header field
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6096 is described as Base in RFC 1808, which is expected to be revised.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6097
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6098 Content-Base = "Content-Base" ":" absoluteURI
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6099
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6100 If no Content-Base field is present, the base URI of an entity is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6101 defined either by its Content-Location (if that Content-Location URI
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6102 is an absolute URI) or the URI used to initiate the request, in that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6103
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6104
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6105
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6106 Fielding, et. al. Standards Track [Page 109]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6107
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6108 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6109
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6110
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6111 order of precedence. Note, however, that the base URI of the contents
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6112 within the entity-body may be redefined within that entity-body.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6113
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6114 14.12 Content-Encoding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6115
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6116 The Content-Encoding entity-header field is used as a modifier to the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6117 media-type. When present, its value indicates what additional content
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6118 codings have been applied to the entity-body, and thus what decoding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6119 mechanisms MUST be applied in order to obtain the media-type
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6120 referenced by the Content-Type header field. Content-Encoding is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6121 primarily used to allow a document to be compressed without losing
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6122 the identity of its underlying media type.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6123
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6124 Content-Encoding = "Content-Encoding" ":" 1#content-coding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6125
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6126 Content codings are defined in section 3.5. An example of its use is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6127
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6128 Content-Encoding: gzip
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6129
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6130 The Content-Encoding is a characteristic of the entity identified by
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6131 the Request-URI. Typically, the entity-body is stored with this
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6132 encoding and is only decoded before rendering or analogous usage.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6133
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6134 If multiple encodings have been applied to an entity, the content
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6135 codings MUST be listed in the order in which they were applied.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6136
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6137 Additional information about the encoding parameters MAY be provided
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6138 by other entity-header fields not defined by this specification.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6139
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6140 14.13 Content-Language
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6141
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6142 The Content-Language entity-header field describes the natural
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6143 language(s) of the intended audience for the enclosed entity. Note
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6144 that this may not be equivalent to all the languages used within the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6145 entity-body.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6146
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6147 Content-Language = "Content-Language" ":" 1#language-tag
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6148
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6149 Language tags are defined in section 3.10. The primary purpose of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6150 Content-Language is to allow a user to identify and differentiate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6151 entities according to the user's own preferred language. Thus, if the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6152 body content is intended only for a Danish-literate audience, the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6153 appropriate field is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6154
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6155 Content-Language: da
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6156
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6157 If no Content-Language is specified, the default is that the content
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6158 is intended for all language audiences. This may mean that the sender
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6159
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6160
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6161
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6162 Fielding, et. al. Standards Track [Page 110]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6163
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6164 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6165
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6166
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6167 does not consider it to be specific to any natural language, or that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6168 the sender does not know for which language it is intended.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6169
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6170 Multiple languages MAY be listed for content that is intended for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6171 multiple audiences. For example, a rendition of the "Treaty of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6172 Waitangi," presented simultaneously in the original Maori and English
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6173 versions, would call for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6174
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6175 Content-Language: mi, en
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6176
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6177 However, just because multiple languages are present within an entity
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6178 does not mean that it is intended for multiple linguistic audiences.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6179 An example would be a beginner's language primer, such as "A First
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6180 Lesson in Latin," which is clearly intended to be used by an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6181 English-literate audience. In this case, the Content-Language should
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6182 only include "en".
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6183
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6184 Content-Language may be applied to any media type -- it is not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6185 limited to textual documents.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6186
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6187 14.14 Content-Length
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6188
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6189 The Content-Length entity-header field indicates the size of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6190 message-body, in decimal number of octets, sent to the recipient or,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6191 in the case of the HEAD method, the size of the entity-body that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6192 would have been sent had the request been a GET.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6193
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6194 Content-Length = "Content-Length" ":" 1*DIGIT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6195
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6196 An example is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6197
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6198 Content-Length: 3495
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6199
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6200 Applications SHOULD use this field to indicate the size of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6201 message-body to be transferred, regardless of the media type of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6202 entity. It must be possible for the recipient to reliably determine
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6203 the end of HTTP/1.1 requests containing an entity-body, e.g., because
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6204 the request has a valid Content-Length field, uses Transfer-Encoding:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6205 chunked or a multipart body.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6206
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6207 Any Content-Length greater than or equal to zero is a valid value.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6208 Section 4.4 describes how to determine the length of a message-body
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6209 if a Content-Length is not given.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6210
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6211
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6212
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6213
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6214
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6215
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6216
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6217
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6218 Fielding, et. al. Standards Track [Page 111]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6219
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6220 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6221
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6222
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6223 Note: The meaning of this field is significantly different from the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6224 corresponding definition in MIME, where it is an optional field
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6225 used within the "message/external-body" content-type. In HTTP, it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6226 SHOULD be sent whenever the message's length can be determined
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6227 prior to being transferred.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6228
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6229 14.15 Content-Location
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6230
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6231 The Content-Location entity-header field may be used to supply the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6232 resource location for the entity enclosed in the message. In the case
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6233 where a resource has multiple entities associated with it, and those
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6234 entities actually have separate locations by which they might be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6235 individually accessed, the server should provide a Content-Location
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6236 for the particular variant which is returned. In addition, a server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6237 SHOULD provide a Content-Location for the resource corresponding to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6238 the response entity.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6239
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6240 Content-Location = "Content-Location" ":"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6241 ( absoluteURI | relativeURI )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6242
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6243 If no Content-Base header field is present, the value of Content-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6244 Location also defines the base URL for the entity (see section
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6245 14.11).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6246
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6247 The Content-Location value is not a replacement for the original
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6248 requested URI; it is only a statement of the location of the resource
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6249 corresponding to this particular entity at the time of the request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6250 Future requests MAY use the Content-Location URI if the desire is to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6251 identify the source of that particular entity.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6252
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6253 A cache cannot assume that an entity with a Content-Location
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6254 different from the URI used to retrieve it can be used to respond to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6255 later requests on that Content-Location URI. However, the Content-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6256 Location can be used to differentiate between multiple entities
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6257 retrieved from a single requested resource, as described in section
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6258 13.6.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6259
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6260 If the Content-Location is a relative URI, the URI is interpreted
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6261 relative to any Content-Base URI provided in the response. If no
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6262 Content-Base is provided, the relative URI is interpreted relative to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6263 the Request-URI.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6264
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6265
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6266
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6267
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6268
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6269
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6270
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6271
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6272
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6273
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6274 Fielding, et. al. Standards Track [Page 112]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6275
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6276 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6277
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6278
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6279 14.16 Content-MD5
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6280
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6281 The Content-MD5 entity-header field, as defined in RFC 1864 [23], is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6282 an MD5 digest of the entity-body for the purpose of providing an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6283 end-to-end message integrity check (MIC) of the entity-body. (Note: a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6284 MIC is good for detecting accidental modification of the entity-body
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6285 in transit, but is not proof against malicious attacks.)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6286
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6287 Content-MD5 = "Content-MD5" ":" md5-digest
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6288
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6289 md5-digest = <base64 of 128 bit MD5 digest as per RFC 1864>
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6290
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6291 The Content-MD5 header field may be generated by an origin server to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6292 function as an integrity check of the entity-body. Only origin
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6293 servers may generate the Content-MD5 header field; proxies and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6294 gateways MUST NOT generate it, as this would defeat its value as an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6295 end-to-end integrity check. Any recipient of the entity-body,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6296 including gateways and proxies, MAY check that the digest value in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6297 this header field matches that of the entity-body as received.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6298
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6299 The MD5 digest is computed based on the content of the entity-body,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6300 including any Content-Encoding that has been applied, but not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6301 including any Transfer-Encoding that may have been applied to the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6302 message-body. If the message is received with a Transfer-Encoding,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6303 that encoding must be removed prior to checking the Content-MD5 value
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6304 against the received entity.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6305
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6306 This has the result that the digest is computed on the octets of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6307 entity-body exactly as, and in the order that, they would be sent if
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6308 no Transfer-Encoding were being applied.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6309
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6310 HTTP extends RFC 1864 to permit the digest to be computed for MIME
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6311 composite media-types (e.g., multipart/* and message/rfc822), but
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6312 this does not change how the digest is computed as defined in the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6313 preceding paragraph.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6314
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6315 Note: There are several consequences of this. The entity-body for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6316 composite types may contain many body-parts, each with its own MIME
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6317 and HTTP headers (including Content-MD5, Content-Transfer-Encoding,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6318 and Content-Encoding headers). If a body-part has a Content-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6319 Transfer-Encoding or Content-Encoding header, it is assumed that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6320 the content of the body-part has had the encoding applied, and the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6321 body-part is included in the Content-MD5 digest as is -- i.e.,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6322 after the application. The Transfer-Encoding header field is not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6323 allowed within body-parts.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6324
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6325 Note: while the definition of Content-MD5 is exactly the same for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6326 HTTP as in RFC 1864 for MIME entity-bodies, there are several ways
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6327
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6328
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6329
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6330 Fielding, et. al. Standards Track [Page 113]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6331
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6332 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6333
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6334
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6335 in which the application of Content-MD5 to HTTP entity-bodies
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6336 differs from its application to MIME entity-bodies. One is that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6337 HTTP, unlike MIME, does not use Content-Transfer-Encoding, and does
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6338 use Transfer-Encoding and Content-Encoding. Another is that HTTP
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6339 more frequently uses binary content types than MIME, so it is worth
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6340 noting that, in such cases, the byte order used to compute the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6341 digest is the transmission byte order defined for the type. Lastly,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6342 HTTP allows transmission of text types with any of several line
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6343 break conventions and not just the canonical form using CRLF.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6344 Conversion of all line breaks to CRLF should not be done before
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6345 computing or checking the digest: the line break convention used in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6346 the text actually transmitted should be left unaltered when
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6347 computing the digest.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6348
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6349 14.17 Content-Range
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6350
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6351 The Content-Range entity-header is sent with a partial entity-body to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6352 specify where in the full entity-body the partial body should be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6353 inserted. It also indicates the total size of the full entity-body.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6354 When a server returns a partial response to a client, it must
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6355 describe both the extent of the range covered by the response, and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6356 the length of the entire entity-body.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6357
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6358 Content-Range = "Content-Range" ":" content-range-spec
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6359
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6360 content-range-spec = byte-content-range-spec
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6361
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6362 byte-content-range-spec = bytes-unit SP first-byte-pos "-"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6363 last-byte-pos "/" entity-length
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6364
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6365 entity-length = 1*DIGIT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6366
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6367 Unlike byte-ranges-specifier values, a byte-content-range-spec may
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6368 only specify one range, and must contain absolute byte positions for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6369 both the first and last byte of the range.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6370
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6371 A byte-content-range-spec whose last-byte-pos value is less than its
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6372 first-byte-pos value, or whose entity-length value is less than or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6373 equal to its last-byte-pos value, is invalid. The recipient of an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6374 invalid byte-content-range-spec MUST ignore it and any content
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6375 transferred along with it.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6376
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6377
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6378
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6379
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6380
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6381
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6382
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6383
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6384
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6385
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6386 Fielding, et. al. Standards Track [Page 114]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6387
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6388 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6389
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6390
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6391 Examples of byte-content-range-spec values, assuming that the entity
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6392 contains a total of 1234 bytes:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6393
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6394 o The first 500 bytes:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6395
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6396 bytes 0-499/1234
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6397
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6398 o The second 500 bytes:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6399
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6400 bytes 500-999/1234
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6401
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6402 o All except for the first 500 bytes:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6403
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6404 bytes 500-1233/1234
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6405
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6406 o The last 500 bytes:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6407
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6408 bytes 734-1233/1234
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6409
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6410 When an HTTP message includes the content of a single range (for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6411 example, a response to a request for a single range, or to a request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6412 for a set of ranges that overlap without any holes), this content is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6413 transmitted with a Content-Range header, and a Content-Length header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6414 showing the number of bytes actually transferred. For example,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6415
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6416 HTTP/1.1 206 Partial content
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6417 Date: Wed, 15 Nov 1995 06:25:24 GMT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6418 Last-modified: Wed, 15 Nov 1995 04:58:08 GMT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6419 Content-Range: bytes 21010-47021/47022
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6420 Content-Length: 26012
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6421 Content-Type: image/gif
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6422
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6423 When an HTTP message includes the content of multiple ranges (for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6424 example, a response to a request for multiple non-overlapping
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6425 ranges), these are transmitted as a multipart MIME message. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6426 multipart MIME content-type used for this purpose is defined in this
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6427 specification to be "multipart/byteranges". See appendix 19.2 for its
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6428 definition.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6429
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6430 A client that cannot decode a MIME multipart/byteranges message
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6431 should not ask for multiple byte-ranges in a single request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6432
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6433 When a client requests multiple byte-ranges in one request, the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6434 server SHOULD return them in the order that they appeared in the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6435 request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6436
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6437 If the server ignores a byte-range-spec because it is invalid, the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6438 server should treat the request as if the invalid Range header field
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6439
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6440
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6441
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6442 Fielding, et. al. Standards Track [Page 115]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6443
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6444 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6445
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6446
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6447 did not exist. (Normally, this means return a 200 response containing
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6448 the full entity). The reason is that the only time a client will make
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6449 such an invalid request is when the entity is smaller than the entity
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6450 retrieved by a prior request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6451
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6452 14.18 Content-Type
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6453
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6454 The Content-Type entity-header field indicates the media type of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6455 entity-body sent to the recipient or, in the case of the HEAD method,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6456 the media type that would have been sent had the request been a GET.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6457
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6458 Content-Type = "Content-Type" ":" media-type
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6459 Media types are defined in section 3.7. An example of the field is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6460
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6461 Content-Type: text/html; charset=ISO-8859-4
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6462
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6463 Further discussion of methods for identifying the media type of an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6464 entity is provided in section 7.2.1.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6465
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6466 14.19 Date
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6467
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6468 The Date general-header field represents the date and time at which
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6469 the message was originated, having the same semantics as orig-date in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6470 RFC 822. The field value is an HTTP-date, as described in section
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6471 3.3.1.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6472
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6473 Date = "Date" ":" HTTP-date
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6474
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6475 An example is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6476
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6477 Date: Tue, 15 Nov 1994 08:12:31 GMT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6478
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6479 If a message is received via direct connection with the user agent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6480 (in the case of requests) or the origin server (in the case of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6481 responses), then the date can be assumed to be the current date at
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6482 the receiving end. However, since the date--as it is believed by the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6483 origin--is important for evaluating cached responses, origin servers
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6484 MUST include a Date header field in all responses. Clients SHOULD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6485 only send a Date header field in messages that include an entity-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6486 body, as in the case of the PUT and POST requests, and even then it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6487 is optional. A received message which does not have a Date header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6488 field SHOULD be assigned one by the recipient if the message will be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6489 cached by that recipient or gatewayed via a protocol which requires a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6490 Date.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6491
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6492
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6493
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6494
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6495
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6496
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6497
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6498 Fielding, et. al. Standards Track [Page 116]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6499
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6500 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6501
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6502
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6503 In theory, the date SHOULD represent the moment just before the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6504 entity is generated. In practice, the date can be generated at any
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6505 time during the message origination without affecting its semantic
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6506 value.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6507
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6508 The format of the Date is an absolute date and time as defined by
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6509 HTTP-date in section 3.3; it MUST be sent in RFC1123 [8]-date format.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6510
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6511 14.20 ETag
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6512
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6513 The ETag entity-header field defines the entity tag for the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6514 associated entity. The headers used with entity tags are described in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6515 sections 14.20, 14.25, 14.26 and 14.43. The entity tag may be used
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6516 for comparison with other entities from the same resource (see
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6517 section 13.3.2).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6518
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6519 ETag = "ETag" ":" entity-tag
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6520
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6521 Examples:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6522
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6523 ETag: "xyzzy"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6524 ETag: W/"xyzzy"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6525 ETag: ""
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6526
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6527 14.21 Expires
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6528
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6529 The Expires entity-header field gives the date/time after which the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6530 response should be considered stale. A stale cache entry may not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6531 normally be returned by a cache (either a proxy cache or an user
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6532 agent cache) unless it is first validated with the origin server (or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6533 with an intermediate cache that has a fresh copy of the entity). See
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6534 section 13.2 for further discussion of the expiration model.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6535
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6536 The presence of an Expires field does not imply that the original
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6537 resource will change or cease to exist at, before, or after that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6538 time.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6539
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6540 The format is an absolute date and time as defined by HTTP-date in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6541 section 3.3; it MUST be in RFC1123-date format:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6542
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6543 Expires = "Expires" ":" HTTP-date
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6544
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6545
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6546
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6547
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6548
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6549
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6550
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6551
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6552
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6553
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6554 Fielding, et. al. Standards Track [Page 117]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6555
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6556 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6557
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6558
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6559 An example of its use is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6560
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6561 Expires: Thu, 01 Dec 1994 16:00:00 GMT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6562
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6563 Note: if a response includes a Cache-Control field with the max-age
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6564 directive, that directive overrides the Expires field.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6565
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6566 HTTP/1.1 clients and caches MUST treat other invalid date formats,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6567 especially including the value "0", as in the past (i.e., "already
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6568 expired").
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6569
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6570 To mark a response as "already expired," an origin server should use
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6571 an Expires date that is equal to the Date header value. (See the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6572 rules for expiration calculations in section 13.2.4.)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6573
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6574 To mark a response as "never expires," an origin server should use an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6575 Expires date approximately one year from the time the response is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6576 sent. HTTP/1.1 servers should not send Expires dates more than one
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6577 year in the future.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6578
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6579 The presence of an Expires header field with a date value of some
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6580 time in the future on an response that otherwise would by default be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6581 non-cacheable indicates that the response is cachable, unless
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6582 indicated otherwise by a Cache-Control header field (section 14.9).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6583
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6584 14.22 From
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6585
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6586 The From request-header field, if given, SHOULD contain an Internet
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6587 e-mail address for the human user who controls the requesting user
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6588 agent. The address SHOULD be machine-usable, as defined by mailbox
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6589 in RFC 822 (as updated by RFC 1123 ):
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6590
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6591 From = "From" ":" mailbox
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6592
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6593 An example is:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6594
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6595 From: webmaster@w3.org
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6596
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6597 This header field MAY be used for logging purposes and as a means for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6598 identifying the source of invalid or unwanted requests. It SHOULD NOT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6599 be used as an insecure form of access protection. The interpretation
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6600 of this field is that the request is being performed on behalf of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6601 person given, who accepts responsibility for the method performed. In
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6602 particular, robot agents SHOULD include this header so that the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6603 person responsible for running the robot can be contacted if problems
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6604 occur on the receiving end.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6605
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6606
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6607
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6608
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6609
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6610 Fielding, et. al. Standards Track [Page 118]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6611
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6612 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6613
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6614
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6615 The Internet e-mail address in this field MAY be separate from the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6616 Internet host which issued the request. For example, when a request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6617 is passed through a proxy the original issuer's address SHOULD be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6618 used.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6619
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6620 Note: The client SHOULD not send the From header field without the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6621 user's approval, as it may conflict with the user's privacy
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6622 interests or their site's security policy. It is strongly
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6623 recommended that the user be able to disable, enable, and modify
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6624 the value of this field at any time prior to a request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6625
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6626 14.23 Host
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6627
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6628 The Host request-header field specifies the Internet host and port
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6629 number of the resource being requested, as obtained from the original
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6630 URL given by the user or referring resource (generally an HTTP URL,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6631 as described in section 3.2.2). The Host field value MUST represent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6632 the network location of the origin server or gateway given by the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6633 original URL. This allows the origin server or gateway to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6634 differentiate between internally-ambiguous URLs, such as the root "/"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6635 URL of a server for multiple host names on a single IP address.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6636
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6637 Host = "Host" ":" host [ ":" port ] ; Section 3.2.2
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6638
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6639 A "host" without any trailing port information implies the default
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6640 port for the service requested (e.g., "80" for an HTTP URL). For
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6641 example, a request on the origin server for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6642 <http://www.w3.org/pub/WWW/> MUST include:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6643
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6644 GET /pub/WWW/ HTTP/1.1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6645 Host: www.w3.org
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6646
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6647 A client MUST include a Host header field in all HTTP/1.1 request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6648 messages on the Internet (i.e., on any message corresponding to a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6649 request for a URL which includes an Internet host address for the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6650 service being requested). If the Host field is not already present,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6651 an HTTP/1.1 proxy MUST add a Host field to the request message prior
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6652 to forwarding it on the Internet. All Internet-based HTTP/1.1 servers
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6653 MUST respond with a 400 status code to any HTTP/1.1 request message
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6654 which lacks a Host header field.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6655
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6656 See sections 5.2 and 19.5.1 for other requirements relating to Host.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6657
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6658 14.24 If-Modified-Since
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6659
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6660 The If-Modified-Since request-header field is used with the GET
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6661 method to make it conditional: if the requested variant has not been
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6662 modified since the time specified in this field, an entity will not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6663
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6664
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6665
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6666 Fielding, et. al. Standards Track [Page 119]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6667
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6668 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6669
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6670
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6671 be returned from the server; instead, a 304 (not modified) response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6672 will be returned without any message-body.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6673
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6674 If-Modified-Since = "If-Modified-Since" ":" HTTP-date
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6675
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6676 An example of the field is:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6677
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6678 If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6679
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6680 A GET method with an If-Modified-Since header and no Range header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6681 requests that the identified entity be transferred only if it has
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6682 been modified since the date given by the If-Modified-Since header.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6683 The algorithm for determining this includes the following cases:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6684
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6685 a)If the request would normally result in anything other than a 200
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6686 (OK) status, or if the passed If-Modified-Since date is invalid, the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6687 response is exactly the same as for a normal GET. A date which is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6688 later than the server's current time is invalid.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6689
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6690 b)If the variant has been modified since the If-Modified-Since date,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6691 the response is exactly the same as for a normal GET.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6692
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6693 c)If the variant has not been modified since a valid If-Modified-Since
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6694 date, the server MUST return a 304 (Not Modified) response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6695
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6696 The purpose of this feature is to allow efficient updates of cached
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6697 information with a minimum amount of transaction overhead.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6698
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6699 Note that the Range request-header field modifies the meaning of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6700 If-Modified-Since; see section 14.36 for full details.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6701
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6702 Note that If-Modified-Since times are interpreted by the server,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6703 whose clock may not be synchronized with the client.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6704
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6705 Note that if a client uses an arbitrary date in the If-Modified-Since
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6706 header instead of a date taken from the Last-Modified header for the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6707 same request, the client should be aware of the fact that this date
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6708 is interpreted in the server's understanding of time. The client
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6709 should consider unsynchronized clocks and rounding problems due to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6710 the different encodings of time between the client and server. This
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6711 includes the possibility of race conditions if the document has
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6712 changed between the time it was first requested and the If-Modified-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6713 Since date of a subsequent request, and the possibility of clock-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6714 skew-related problems if the If-Modified-Since date is derived from
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6715 the client's clock without correction to the server's clock.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6716 Corrections for different time bases between client and server are at
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6717 best approximate due to network latency.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6718
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6719
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6720
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6721
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6722 Fielding, et. al. Standards Track [Page 120]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6723
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6724 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6725
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6726
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6727 14.25 If-Match
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6728
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6729 The If-Match request-header field is used with a method to make it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6730 conditional. A client that has one or more entities previously
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6731 obtained from the resource can verify that one of those entities is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6732 current by including a list of their associated entity tags in the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6733 If-Match header field. The purpose of this feature is to allow
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6734 efficient updates of cached information with a minimum amount of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6735 transaction overhead. It is also used, on updating requests, to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6736 prevent inadvertent modification of the wrong version of a resource.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6737 As a special case, the value "*" matches any current entity of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6738 resource.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6739
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6740 If-Match = "If-Match" ":" ( "*" | 1#entity-tag )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6741
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6742 If any of the entity tags match the entity tag of the entity that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6743 would have been returned in the response to a similar GET request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6744 (without the If-Match header) on that resource, or if "*" is given
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6745 and any current entity exists for that resource, then the server MAY
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6746 perform the requested method as if the If-Match header field did not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6747 exist.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6748
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6749 A server MUST use the strong comparison function (see section 3.11)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6750 to compare the entity tags in If-Match.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6751
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6752 If none of the entity tags match, or if "*" is given and no current
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6753 entity exists, the server MUST NOT perform the requested method, and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6754 MUST return a 412 (Precondition Failed) response. This behavior is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6755 most useful when the client wants to prevent an updating method, such
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6756 as PUT, from modifying a resource that has changed since the client
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6757 last retrieved it.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6758
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6759 If the request would, without the If-Match header field, result in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6760 anything other than a 2xx status, then the If-Match header MUST be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6761 ignored.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6762
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6763 The meaning of "If-Match: *" is that the method SHOULD be performed
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6764 if the representation selected by the origin server (or by a cache,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6765 possibly using the Vary mechanism, see section 14.43) exists, and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6766 MUST NOT be performed if the representation does not exist.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6767
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6768
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6769
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6770
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6771
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6772
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6773
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6774
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6775
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6776
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6777
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6778 Fielding, et. al. Standards Track [Page 121]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6779
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6780 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6781
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6782
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6783 A request intended to update a resource (e.g., a PUT) MAY include an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6784 If-Match header field to signal that the request method MUST NOT be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6785 applied if the entity corresponding to the If-Match value (a single
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6786 entity tag) is no longer a representation of that resource. This
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6787 allows the user to indicate that they do not wish the request to be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6788 successful if the resource has been changed without their knowledge.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6789 Examples:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6790
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6791 If-Match: "xyzzy"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6792 If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6793 If-Match: *
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6794
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6795 14.26 If-None-Match
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6796
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6797 The If-None-Match request-header field is used with a method to make
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6798 it conditional. A client that has one or more entities previously
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6799 obtained from the resource can verify that none of those entities is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6800 current by including a list of their associated entity tags in the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6801 If-None-Match header field. The purpose of this feature is to allow
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6802 efficient updates of cached information with a minimum amount of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6803 transaction overhead. It is also used, on updating requests, to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6804 prevent inadvertent modification of a resource which was not known to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6805 exist.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6806
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6807 As a special case, the value "*" matches any current entity of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6808 resource.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6809
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6810 If-None-Match = "If-None-Match" ":" ( "*" | 1#entity-tag )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6811
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6812 If any of the entity tags match the entity tag of the entity that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6813 would have been returned in the response to a similar GET request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6814 (without the If-None-Match header) on that resource, or if "*" is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6815 given and any current entity exists for that resource, then the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6816 server MUST NOT perform the requested method. Instead, if the request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6817 method was GET or HEAD, the server SHOULD respond with a 304 (Not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6818 Modified) response, including the cache-related entity-header fields
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6819 (particularly ETag) of one of the entities that matched. For all
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6820 other request methods, the server MUST respond with a status of 412
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6821 (Precondition Failed).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6822
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6823 See section 13.3.3 for rules on how to determine if two entity tags
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6824 match. The weak comparison function can only be used with GET or HEAD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6825 requests.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6826
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6827 If none of the entity tags match, or if "*" is given and no current
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6828 entity exists, then the server MAY perform the requested method as if
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6829 the If-None-Match header field did not exist.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6830
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6831
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6832
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6833
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6834 Fielding, et. al. Standards Track [Page 122]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6835
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6836 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6837
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6838
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6839 If the request would, without the If-None-Match header field, result
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6840 in anything other than a 2xx status, then the If-None-Match header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6841 MUST be ignored.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6842
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6843 The meaning of "If-None-Match: *" is that the method MUST NOT be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6844 performed if the representation selected by the origin server (or by
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6845 a cache, possibly using the Vary mechanism, see section 14.43)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6846 exists, and SHOULD be performed if the representation does not exist.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6847 This feature may be useful in preventing races between PUT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6848 operations.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6849
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6850 Examples:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6851
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6852 If-None-Match: "xyzzy"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6853 If-None-Match: W/"xyzzy"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6854 If-None-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6855 If-None-Match: W/"xyzzy", W/"r2d2xxxx", W/"c3piozzzz"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6856 If-None-Match: *
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6857
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6858 14.27 If-Range
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6859
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6860 If a client has a partial copy of an entity in its cache, and wishes
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6861 to have an up-to-date copy of the entire entity in its cache, it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6862 could use the Range request-header with a conditional GET (using
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6863 either or both of If-Unmodified-Since and If-Match.) However, if the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6864 condition fails because the entity has been modified, the client
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6865 would then have to make a second request to obtain the entire current
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6866 entity-body.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6867
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6868 The If-Range header allows a client to "short-circuit" the second
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6869 request. Informally, its meaning is `if the entity is unchanged, send
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6870 me the part(s) that I am missing; otherwise, send me the entire new
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6871 entity.'
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6872
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6873 If-Range = "If-Range" ":" ( entity-tag | HTTP-date )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6874
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6875 If the client has no entity tag for an entity, but does have a Last-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6876 Modified date, it may use that date in a If-Range header. (The server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6877 can distinguish between a valid HTTP-date and any form of entity-tag
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6878 by examining no more than two characters.) The If-Range header should
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6879 only be used together with a Range header, and must be ignored if the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6880 request does not include a Range header, or if the server does not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6881 support the sub-range operation.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6882
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6883
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6884
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6885
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6886
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6887
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6888
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6889
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6890 Fielding, et. al. Standards Track [Page 123]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6891
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6892 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6893
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6894
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6895 If the entity tag given in the If-Range header matches the current
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6896 entity tag for the entity, then the server should provide the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6897 specified sub-range of the entity using a 206 (Partial content)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6898 response. If the entity tag does not match, then the server should
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6899 return the entire entity using a 200 (OK) response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6900
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6901 14.28 If-Unmodified-Since
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6902
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6903 The If-Unmodified-Since request-header field is used with a method to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6904 make it conditional. If the requested resource has not been modified
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6905 since the time specified in this field, the server should perform the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6906 requested operation as if the If-Unmodified-Since header were not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6907 present.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6908
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6909 If the requested variant has been modified since the specified time,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6910 the server MUST NOT perform the requested operation, and MUST return
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6911 a 412 (Precondition Failed).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6912
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6913 If-Unmodified-Since = "If-Unmodified-Since" ":" HTTP-date
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6914
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6915 An example of the field is:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6916
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6917 If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6918
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6919 If the request normally (i.e., without the If-Unmodified-Since
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6920 header) would result in anything other than a 2xx status, the If-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6921 Unmodified-Since header should be ignored.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6922
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6923 If the specified date is invalid, the header is ignored.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6924
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6925 14.29 Last-Modified
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6926
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6927 The Last-Modified entity-header field indicates the date and time at
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6928 which the origin server believes the variant was last modified.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6929
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6930 Last-Modified = "Last-Modified" ":" HTTP-date
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6931
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6932 An example of its use is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6933
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6934 Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6935
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6936 The exact meaning of this header field depends on the implementation
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6937 of the origin server and the nature of the original resource. For
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6938 files, it may be just the file system last-modified time. For
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6939 entities with dynamically included parts, it may be the most recent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6940 of the set of last-modify times for its component parts. For database
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6941 gateways, it may be the last-update time stamp of the record. For
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6942 virtual objects, it may be the last time the internal state changed.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6943
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6944
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6945
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6946 Fielding, et. al. Standards Track [Page 124]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6947
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6948 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6949
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6950
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6951 An origin server MUST NOT send a Last-Modified date which is later
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6952 than the server's time of message origination. In such cases, where
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6953 the resource's last modification would indicate some time in the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6954 future, the server MUST replace that date with the message
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6955 origination date.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6956
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6957 An origin server should obtain the Last-Modified value of the entity
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6958 as close as possible to the time that it generates the Date value of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6959 its response. This allows a recipient to make an accurate assessment
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6960 of the entity's modification time, especially if the entity changes
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6961 near the time that the response is generated.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6962
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6963 HTTP/1.1 servers SHOULD send Last-Modified whenever feasible.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6964
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6965 14.30 Location
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6966
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6967 The Location response-header field is used to redirect the recipient
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6968 to a location other than the Request-URI for completion of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6969 request or identification of a new resource. For 201 (Created)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6970 responses, the Location is that of the new resource which was created
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6971 by the request. For 3xx responses, the location SHOULD indicate the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6972 server's preferred URL for automatic redirection to the resource. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6973 field value consists of a single absolute URL.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6974
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6975 Location = "Location" ":" absoluteURI
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6976
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6977 An example is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6978
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6979 Location: http://www.w3.org/pub/WWW/People.html
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6980
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6981 Note: The Content-Location header field (section 14.15) differs
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6982 from Location in that the Content-Location identifies the original
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6983 location of the entity enclosed in the request. It is therefore
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6984 possible for a response to contain header fields for both Location
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6985 and Content-Location. Also see section 13.10 for cache requirements
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6986 of some methods.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6987
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6988 14.31 Max-Forwards
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6989
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6990 The Max-Forwards request-header field may be used with the TRACE
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6991 method (section 14.31) to limit the number of proxies or gateways
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6992 that can forward the request to the next inbound server. This can be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6993 useful when the client is attempting to trace a request chain which
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6994 appears to be failing or looping in mid-chain.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6995
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6996 Max-Forwards = "Max-Forwards" ":" 1*DIGIT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6998
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6999
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7000
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7001
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7002 Fielding, et. al. Standards Track [Page 125]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7003
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7004 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7005
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7006
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7007 The Max-Forwards value is a decimal integer indicating the remaining
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7008 number of times this request message may be forwarded.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7009
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7010 Each proxy or gateway recipient of a TRACE request containing a Max-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7011 Forwards header field SHOULD check and update its value prior to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7012 forwarding the request. If the received value is zero (0), the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7013 recipient SHOULD NOT forward the request; instead, it SHOULD respond
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7014 as the final recipient with a 200 (OK) response containing the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7015 received request message as the response entity-body (as described in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7016 section 9.8). If the received Max-Forwards value is greater than
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7017 zero, then the forwarded message SHOULD contain an updated Max-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7018 Forwards field with a value decremented by one (1).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7019
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7020 The Max-Forwards header field SHOULD be ignored for all other methods
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7021 defined by this specification and for any extension methods for which
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7022 it is not explicitly referred to as part of that method definition.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7023
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7024 14.32 Pragma
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7025
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7026 The Pragma general-header field is used to include implementation-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7027 specific directives that may apply to any recipient along the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7028 request/response chain. All pragma directives specify optional
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7029 behavior from the viewpoint of the protocol; however, some systems
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7030 MAY require that behavior be consistent with the directives.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7031
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7032 Pragma = "Pragma" ":" 1#pragma-directive
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7033
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7034 pragma-directive = "no-cache" | extension-pragma
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7035 extension-pragma = token [ "=" ( token | quoted-string ) ]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7036
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7037 When the no-cache directive is present in a request message, an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7038 application SHOULD forward the request toward the origin server even
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7039 if it has a cached copy of what is being requested. This pragma
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7040 directive has the same semantics as the no-cache cache-directive (see
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7041 section 14.9) and is defined here for backwards compatibility with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7042 HTTP/1.0. Clients SHOULD include both header fields when a no-cache
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7043 request is sent to a server not known to be HTTP/1.1 compliant.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7044
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7045 Pragma directives MUST be passed through by a proxy or gateway
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7046 application, regardless of their significance to that application,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7047 since the directives may be applicable to all recipients along the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7048 request/response chain. It is not possible to specify a pragma for a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7049 specific recipient; however, any pragma directive not relevant to a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7050 recipient SHOULD be ignored by that recipient.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7051
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7052
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7053
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7054
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7055
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7056
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7057
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7058 Fielding, et. al. Standards Track [Page 126]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7059
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7060 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7061
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7062
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7063 HTTP/1.1 clients SHOULD NOT send the Pragma request-header. HTTP/1.1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7064 caches SHOULD treat "Pragma: no-cache" as if the client had sent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7065 "Cache-Control: no-cache". No new Pragma directives will be defined
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7066 in HTTP.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7067
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7068 14.33 Proxy-Authenticate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7069
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7070 The Proxy-Authenticate response-header field MUST be included as part
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7071 of a 407 (Proxy Authentication Required) response. The field value
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7072 consists of a challenge that indicates the authentication scheme and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7073 parameters applicable to the proxy for this Request-URI.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7074
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7075 Proxy-Authenticate = "Proxy-Authenticate" ":" challenge
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7076
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7077 The HTTP access authentication process is described in section 11.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7078 Unlike WWW-Authenticate, the Proxy-Authenticate header field applies
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7079 only to the current connection and SHOULD NOT be passed on to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7080 downstream clients. However, an intermediate proxy may need to obtain
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7081 its own credentials by requesting them from the downstream client,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7082 which in some circumstances will appear as if the proxy is forwarding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7083 the Proxy-Authenticate header field.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7084
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7085 14.34 Proxy-Authorization
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7086
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7087 The Proxy-Authorization request-header field allows the client to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7088 identify itself (or its user) to a proxy which requires
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7089 authentication. The Proxy-Authorization field value consists of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7090 credentials containing the authentication information of the user
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7091 agent for the proxy and/or realm of the resource being requested.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7092
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7093 Proxy-Authorization = "Proxy-Authorization" ":" credentials
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7094
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7095 The HTTP access authentication process is described in section 11.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7096 Unlike Authorization, the Proxy-Authorization header field applies
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7097 only to the next outbound proxy that demanded authentication using
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7098 the Proxy-Authenticate field. When multiple proxies are used in a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7099 chain, the Proxy-Authorization header field is consumed by the first
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7100 outbound proxy that was expecting to receive credentials. A proxy MAY
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7101 relay the credentials from the client request to the next proxy if
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7102 that is the mechanism by which the proxies cooperatively authenticate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7103 a given request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7104
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7105 14.35 Public
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7106
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7107 The Public response-header field lists the set of methods supported
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7108 by the server. The purpose of this field is strictly to inform the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7109 recipient of the capabilities of the server regarding unusual
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7110 methods. The methods listed may or may not be applicable to the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7111
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7112
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7113
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7114 Fielding, et. al. Standards Track [Page 127]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7115
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7116 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7117
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7118
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7119 Request-URI; the Allow header field (section 14.7) MAY be used to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7120 indicate methods allowed for a particular URI.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7121
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7122 Public = "Public" ":" 1#method
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7123
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7124 Example of use:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7125
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7126 Public: OPTIONS, MGET, MHEAD, GET, HEAD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7127
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7128 This header field applies only to the server directly connected to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7129 the client (i.e., the nearest neighbor in a chain of connections). If
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7130 the response passes through a proxy, the proxy MUST either remove the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7131 Public header field or replace it with one applicable to its own
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7132 capabilities.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7133
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7134 14.36 Range
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7135
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7136 14.36.1 Byte Ranges
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7137
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7138 Since all HTTP entities are represented in HTTP messages as sequences
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7139 of bytes, the concept of a byte range is meaningful for any HTTP
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7140 entity. (However, not all clients and servers need to support byte-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7141 range operations.)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7142
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7143 Byte range specifications in HTTP apply to the sequence of bytes in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7144 the entity-body (not necessarily the same as the message-body).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7145
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7146 A byte range operation may specify a single range of bytes, or a set
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7147 of ranges within a single entity.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7148
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7149 ranges-specifier = byte-ranges-specifier
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7150
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7151 byte-ranges-specifier = bytes-unit "=" byte-range-set
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7152
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7153 byte-range-set = 1#( byte-range-spec | suffix-byte-range-spec )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7154
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7155 byte-range-spec = first-byte-pos "-" [last-byte-pos]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7156
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7157 first-byte-pos = 1*DIGIT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7158
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7159 last-byte-pos = 1*DIGIT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7160
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7161 The first-byte-pos value in a byte-range-spec gives the byte-offset
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7162 of the first byte in a range. The last-byte-pos value gives the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7163 byte-offset of the last byte in the range; that is, the byte
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7164 positions specified are inclusive. Byte offsets start at zero.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7165
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7166
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7167
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7168
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7169
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7170 Fielding, et. al. Standards Track [Page 128]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7171
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7172 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7173
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7174
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7175 If the last-byte-pos value is present, it must be greater than or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7176 equal to the first-byte-pos in that byte-range-spec, or the byte-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7177 range-spec is invalid. The recipient of an invalid byte-range-spec
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7178 must ignore it.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7179
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7180 If the last-byte-pos value is absent, or if the value is greater than
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7181 or equal to the current length of the entity-body, last-byte-pos is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7182 taken to be equal to one less than the current length of the entity-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7183 body in bytes.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7184
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7185 By its choice of last-byte-pos, a client can limit the number of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7186 bytes retrieved without knowing the size of the entity.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7187
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7188 suffix-byte-range-spec = "-" suffix-length
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7189
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7190 suffix-length = 1*DIGIT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7191
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7192 A suffix-byte-range-spec is used to specify the suffix of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7193 entity-body, of a length given by the suffix-length value. (That is,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7194 this form specifies the last N bytes of an entity-body.) If the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7195 entity is shorter than the specified suffix-length, the entire
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7196 entity-body is used.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7197
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7198 Examples of byte-ranges-specifier values (assuming an entity-body of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7199 length 10000):
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7200
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7201 o The first 500 bytes (byte offsets 0-499, inclusive):
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7202
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7203 bytes=0-499
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7204
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7205 o The second 500 bytes (byte offsets 500-999, inclusive):
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7206
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7207 bytes=500-999
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7208
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7209 o The final 500 bytes (byte offsets 9500-9999, inclusive):
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7210
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7211 bytes=-500
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7212
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7213 o Or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7214
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7215 bytes=9500-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7216
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7217 o The first and last bytes only (bytes 0 and 9999):
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7218
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7219 bytes=0-0,-1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7220
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7221
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7222
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7223
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7224
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7225
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7226 Fielding, et. al. Standards Track [Page 129]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7227
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7228 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7229
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7230
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7231 o Several legal but not canonical specifications of the second
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7232 500 bytes (byte offsets 500-999, inclusive):
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7233
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7234 bytes=500-600,601-999
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7235
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7236 bytes=500-700,601-999
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7237
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7238 14.36.2 Range Retrieval Requests
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7239
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7240 HTTP retrieval requests using conditional or unconditional GET
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7241 methods may request one or more sub-ranges of the entity, instead of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7242 the entire entity, using the Range request header, which applies to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7243 the entity returned as the result of the request:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7244
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7245 Range = "Range" ":" ranges-specifier
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7246
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7247 A server MAY ignore the Range header. However, HTTP/1.1 origin
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7248 servers and intermediate caches SHOULD support byte ranges when
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7249 possible, since Range supports efficient recovery from partially
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7250 failed transfers, and supports efficient partial retrieval of large
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7251 entities.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7252
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7253 If the server supports the Range header and the specified range or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7254 ranges are appropriate for the entity:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7255
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7256 o The presence of a Range header in an unconditional GET modifies
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7257 what is returned if the GET is otherwise successful. In other
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7258 words, the response carries a status code of 206 (Partial
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7259 Content) instead of 200 (OK).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7260
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7261 o The presence of a Range header in a conditional GET (a request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7262 using one or both of If-Modified-Since and If-None-Match, or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7263 one or both of If-Unmodified-Since and If-Match) modifies what
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7264 is returned if the GET is otherwise successful and the condition
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7265 is true. It does not affect the 304 (Not Modified) response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7266 returned if the conditional is false.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7267
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7268 In some cases, it may be more appropriate to use the If-Range header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7269 (see section 14.27) in addition to the Range header.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7270
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7271 If a proxy that supports ranges receives a Range request, forwards
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7272 the request to an inbound server, and receives an entire entity in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7273 reply, it SHOULD only return the requested range to its client. It
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7274 SHOULD store the entire received response in its cache, if that is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7275 consistent with its cache allocation policies.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7276
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7277
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7278
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7279
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7280
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7281
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7282 Fielding, et. al. Standards Track [Page 130]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7283
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7284 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7285
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7286
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7287 14.37 Referer
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7288
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7289 The Referer[sic] request-header field allows the client to specify,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7290 for the server's benefit, the address (URI) of the resource from
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7291 which the Request-URI was obtained (the "referrer", although the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7292 header field is misspelled.) The Referer request-header allows a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7293 server to generate lists of back-links to resources for interest,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7294 logging, optimized caching, etc. It also allows obsolete or mistyped
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7295 links to be traced for maintenance. The Referer field MUST NOT be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7296 sent if the Request-URI was obtained from a source that does not have
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7297 its own URI, such as input from the user keyboard.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7298
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7299 Referer = "Referer" ":" ( absoluteURI | relativeURI )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7300
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7301 Example:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7302
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7303 Referer: http://www.w3.org/hypertext/DataSources/Overview.html
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7304
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7305 If the field value is a partial URI, it SHOULD be interpreted
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7306 relative to the Request-URI. The URI MUST NOT include a fragment.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7307
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7308 Note: Because the source of a link may be private information or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7309 may reveal an otherwise private information source, it is strongly
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7310 recommended that the user be able to select whether or not the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7311 Referer field is sent. For example, a browser client could have a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7312 toggle switch for browsing openly/anonymously, which would
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7313 respectively enable/disable the sending of Referer and From
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7314 information.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7315
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7316 14.38 Retry-After
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7317
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7318 The Retry-After response-header field can be used with a 503 (Service
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7319 Unavailable) response to indicate how long the service is expected to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7320 be unavailable to the requesting client. The value of this field can
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7321 be either an HTTP-date or an integer number of seconds (in decimal)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7322 after the time of the response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7323
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7324 Retry-After = "Retry-After" ":" ( HTTP-date | delta-seconds )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7325
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7326 Two examples of its use are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7327
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7328 Retry-After: Fri, 31 Dec 1999 23:59:59 GMT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7329 Retry-After: 120
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7330
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7331 In the latter example, the delay is 2 minutes.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7332
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7333
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7334
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7335
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7336
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7337
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7338 Fielding, et. al. Standards Track [Page 131]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7339
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7340 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7341
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7342
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7343 14.39 Server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7344
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7345 The Server response-header field contains information about the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7346 software used by the origin server to handle the request. The field
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7347 can contain multiple product tokens (section 3.8) and comments
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7348 identifying the server and any significant subproducts. The product
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7349 tokens are listed in order of their significance for identifying the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7350 application.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7351
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7352 Server = "Server" ":" 1*( product | comment )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7353
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7354 Example:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7355
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7356 Server: CERN/3.0 libwww/2.17
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7357
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7358 If the response is being forwarded through a proxy, the proxy
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7359 application MUST NOT modify the Server response-header. Instead, it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7360 SHOULD include a Via field (as described in section 14.44).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7361
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7362 Note: Revealing the specific software version of the server may
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7363 allow the server machine to become more vulnerable to attacks
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7364 against software that is known to contain security holes. Server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7365 implementers are encouraged to make this field a configurable
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7366 option.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7367
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7368 14.40 Transfer-Encoding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7369
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7370 The Transfer-Encoding general-header field indicates what (if any)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7371 type of transformation has been applied to the message body in order
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7372 to safely transfer it between the sender and the recipient. This
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7373 differs from the Content-Encoding in that the transfer coding is a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7374 property of the message, not of the entity.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7375
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7376 Transfer-Encoding = "Transfer-Encoding" ":" 1#transfer-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7377 coding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7378
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7379 Transfer codings are defined in section 3.6. An example is:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7380
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7381 Transfer-Encoding: chunked
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7382
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7383 Many older HTTP/1.0 applications do not understand the Transfer-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7384 Encoding header.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7385
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7386 14.41 Upgrade
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7387
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7388 The Upgrade general-header allows the client to specify what
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7389 additional communication protocols it supports and would like to use
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7390 if the server finds it appropriate to switch protocols. The server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7391
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7392
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7393
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7394 Fielding, et. al. Standards Track [Page 132]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7395
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7396 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7397
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7398
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7399 MUST use the Upgrade header field within a 101 (Switching Protocols)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7400 response to indicate which protocol(s) are being switched.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7401
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7402 Upgrade = "Upgrade" ":" 1#product
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7403
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7404 For example,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7405
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7406 Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7407
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7408 The Upgrade header field is intended to provide a simple mechanism
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7409 for transition from HTTP/1.1 to some other, incompatible protocol. It
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7410 does so by allowing the client to advertise its desire to use another
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7411 protocol, such as a later version of HTTP with a higher major version
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7412 number, even though the current request has been made using HTTP/1.1.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7413 This eases the difficult transition between incompatible protocols by
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7414 allowing the client to initiate a request in the more commonly
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7415 supported protocol while indicating to the server that it would like
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7416 to use a "better" protocol if available (where "better" is determined
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7417 by the server, possibly according to the nature of the method and/or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7418 resource being requested).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7419
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7420 The Upgrade header field only applies to switching application-layer
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7421 protocols upon the existing transport-layer connection. Upgrade
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7422 cannot be used to insist on a protocol change; its acceptance and use
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7423 by the server is optional. The capabilities and nature of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7424 application-layer communication after the protocol change is entirely
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7425 dependent upon the new protocol chosen, although the first action
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7426 after changing the protocol MUST be a response to the initial HTTP
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7427 request containing the Upgrade header field.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7428
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7429 The Upgrade header field only applies to the immediate connection.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7430 Therefore, the upgrade keyword MUST be supplied within a Connection
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7431 header field (section 14.10) whenever Upgrade is present in an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7432 HTTP/1.1 message.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7433
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7434 The Upgrade header field cannot be used to indicate a switch to a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7435 protocol on a different connection. For that purpose, it is more
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7436 appropriate to use a 301, 302, 303, or 305 redirection response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7437
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7438 This specification only defines the protocol name "HTTP" for use by
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7439 the family of Hypertext Transfer Protocols, as defined by the HTTP
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7440 version rules of section 3.1 and future updates to this
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7441 specification. Any token can be used as a protocol name; however, it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7442 will only be useful if both the client and server associate the name
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7443 with the same protocol.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7444
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7445
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7446
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7447
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7448
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7449
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7450 Fielding, et. al. Standards Track [Page 133]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7451
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7452 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7453
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7454
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7455 14.42 User-Agent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7456
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7457 The User-Agent request-header field contains information about the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7458 user agent originating the request. This is for statistical purposes,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7459 the tracing of protocol violations, and automated recognition of user
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7460 agents for the sake of tailoring responses to avoid particular user
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7461 agent limitations. User agents SHOULD include this field with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7462 requests. The field can contain multiple product tokens (section 3.8)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7463 and comments identifying the agent and any subproducts which form a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7464 significant part of the user agent. By convention, the product tokens
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7465 are listed in order of their significance for identifying the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7466 application.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7467
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7468 User-Agent = "User-Agent" ":" 1*( product | comment )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7469
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7470 Example:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7471
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7472 User-Agent: CERN-LineMode/2.15 libwww/2.17b3
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7473
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7474 14.43 Vary
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7475
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7476 The Vary response-header field is used by a server to signal that the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7477 response entity was selected from the available representations of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7478 the response using server-driven negotiation (section 12). Field-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7479 names listed in Vary headers are those of request-headers. The Vary
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7480 field value indicates either that the given set of header fields
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7481 encompass the dimensions over which the representation might vary, or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7482 that the dimensions of variance are unspecified ("*") and thus may
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7483 vary over any aspect of future requests.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7484
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7485 Vary = "Vary" ":" ( "*" | 1#field-name )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7486
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7487 An HTTP/1.1 server MUST include an appropriate Vary header field with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7488 any cachable response that is subject to server-driven negotiation.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7489 Doing so allows a cache to properly interpret future requests on that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7490 resource and informs the user agent about the presence of negotiation
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7491 on that resource. A server SHOULD include an appropriate Vary header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7492 field with a non-cachable response that is subject to server-driven
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7493 negotiation, since this might provide the user agent with useful
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7494 information about the dimensions over which the response might vary.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7495
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7496 The set of header fields named by the Vary field value is known as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7497 the "selecting" request-headers.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7498
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7499 When the cache receives a subsequent request whose Request-URI
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7500 specifies one or more cache entries including a Vary header, the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7501 cache MUST NOT use such a cache entry to construct a response to the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7502 new request unless all of the headers named in the cached Vary header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7503
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7504
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7505
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7506 Fielding, et. al. Standards Track [Page 134]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7507
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7508 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7509
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7510
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7511 are present in the new request, and all of the stored selecting
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7512 request-headers from the previous request match the corresponding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7513 headers in the new request.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7514
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7515 The selecting request-headers from two requests are defined to match
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7516 if and only if the selecting request-headers in the first request can
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7517 be transformed to the selecting request-headers in the second request
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7518 by adding or removing linear whitespace (LWS) at places where this is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7519 allowed by the corresponding BNF, and/or combining multiple message-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7520 header fields with the same field name following the rules about
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7521 message headers in section 4.2.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7522
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7523 A Vary field value of "*" signals that unspecified parameters,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7524 possibly other than the contents of request-header fields (e.g., the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7525 network address of the client), play a role in the selection of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7526 response representation. Subsequent requests on that resource can
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7527 only be properly interpreted by the origin server, and thus a cache
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7528 MUST forward a (possibly conditional) request even when it has a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7529 fresh response cached for the resource. See section 13.6 for use of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7530 the Vary header by caches.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7531
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7532 A Vary field value consisting of a list of field-names signals that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7533 the representation selected for the response is based on a selection
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7534 algorithm which considers ONLY the listed request-header field values
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7535 in selecting the most appropriate representation. A cache MAY assume
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7536 that the same selection will be made for future requests with the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7537 same values for the listed field names, for the duration of time in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7538 which the response is fresh.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7539
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7540 The field-names given are not limited to the set of standard
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7541 request-header fields defined by this specification. Field names are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7542 case-insensitive.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7543
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7544 14.44 Via
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7545
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7546 The Via general-header field MUST be used by gateways and proxies to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7547 indicate the intermediate protocols and recipients between the user
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7548 agent and the server on requests, and between the origin server and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7549 the client on responses. It is analogous to the "Received" field of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7550 RFC 822 and is intended to be used for tracking message forwards,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7551 avoiding request loops, and identifying the protocol capabilities of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7552 all senders along the request/response chain.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7553
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7554
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7555
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7556
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7557
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7558
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7559
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7560
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7561
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7562 Fielding, et. al. Standards Track [Page 135]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7563
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7564 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7565
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7566
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7567 Via = "Via" ":" 1#( received-protocol received-by [ comment ] )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7568
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7569 received-protocol = [ protocol-name "/" ] protocol-version
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7570 protocol-name = token
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7571 protocol-version = token
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7572 received-by = ( host [ ":" port ] ) | pseudonym
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7573 pseudonym = token
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7574
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7575 The received-protocol indicates the protocol version of the message
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7576 received by the server or client along each segment of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7577 request/response chain. The received-protocol version is appended to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7578 the Via field value when the message is forwarded so that information
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7579 about the protocol capabilities of upstream applications remains
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7580 visible to all recipients.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7581
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7582 The protocol-name is optional if and only if it would be "HTTP". The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7583 received-by field is normally the host and optional port number of a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7584 recipient server or client that subsequently forwarded the message.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7585 However, if the real host is considered to be sensitive information,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7586 it MAY be replaced by a pseudonym. If the port is not given, it MAY
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7587 be assumed to be the default port of the received-protocol.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7588
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7589 Multiple Via field values represent each proxy or gateway that has
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7590 forwarded the message. Each recipient MUST append its information
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7591 such that the end result is ordered according to the sequence of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7592 forwarding applications.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7593
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7594 Comments MAY be used in the Via header field to identify the software
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7595 of the recipient proxy or gateway, analogous to the User-Agent and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7596 Server header fields. However, all comments in the Via field are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7597 optional and MAY be removed by any recipient prior to forwarding the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7598 message.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7599
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7600 For example, a request message could be sent from an HTTP/1.0 user
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7601 agent to an internal proxy code-named "fred", which uses HTTP/1.1 to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7602 forward the request to a public proxy at nowhere.com, which completes
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7603 the request by forwarding it to the origin server at www.ics.uci.edu.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7604 The request received by www.ics.uci.edu would then have the following
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7605 Via header field:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7606
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7607 Via: 1.0 fred, 1.1 nowhere.com (Apache/1.1)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7608
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7609 Proxies and gateways used as a portal through a network firewall
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7610 SHOULD NOT, by default, forward the names and ports of hosts within
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7611 the firewall region. This information SHOULD only be propagated if
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7612 explicitly enabled. If not enabled, the received-by host of any host
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7613 behind the firewall SHOULD be replaced by an appropriate pseudonym
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7614 for that host.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7615
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7616
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7617
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7618 Fielding, et. al. Standards Track [Page 136]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7619
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7620 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7621
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7622
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7623 For organizations that have strong privacy requirements for hiding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7624 internal structures, a proxy MAY combine an ordered subsequence of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7625 Via header field entries with identical received-protocol values into
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7626 a single such entry. For example,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7627
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7628 Via: 1.0 ricky, 1.1 ethel, 1.1 fred, 1.0 lucy
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7629
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7630 could be collapsed to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7631
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7632 Via: 1.0 ricky, 1.1 mertz, 1.0 lucy
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7633
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7634 Applications SHOULD NOT combine multiple entries unless they are all
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7635 under the same organizational control and the hosts have already been
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7636 replaced by pseudonyms. Applications MUST NOT combine entries which
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7637 have different received-protocol values.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7638
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7639 14.45 Warning
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7640
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7641 The Warning response-header field is used to carry additional
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7642 information about the status of a response which may not be reflected
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7643 by the response status code. This information is typically, though
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7644 not exclusively, used to warn about a possible lack of semantic
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7645 transparency from caching operations.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7646
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7647 Warning headers are sent with responses using:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7648
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7649 Warning = "Warning" ":" 1#warning-value
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7650
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7651 warning-value = warn-code SP warn-agent SP warn-text
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7652 warn-code = 2DIGIT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7653 warn-agent = ( host [ ":" port ] ) | pseudonym
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7654 ; the name or pseudonym of the server adding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7655 ; the Warning header, for use in debugging
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7656 warn-text = quoted-string
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7657
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7658 A response may carry more than one Warning header.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7659
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7660 The warn-text should be in a natural language and character set that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7661 is most likely to be intelligible to the human user receiving the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7662 response. This decision may be based on any available knowledge,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7663 such as the location of the cache or user, the Accept-Language field
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7664 in a request, the Content-Language field in a response, etc. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7665 default language is English and the default character set is ISO-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7666 8859-1.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7667
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7668 If a character set other than ISO-8859-1 is used, it MUST be encoded
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7669 in the warn-text using the method described in RFC 1522 [14].
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7670
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7671
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7672
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7673
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7674 Fielding, et. al. Standards Track [Page 137]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7675
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7676 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7677
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7678
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7679 Any server or cache may add Warning headers to a response. New
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7680 Warning headers should be added after any existing Warning headers. A
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7681 cache MUST NOT delete any Warning header that it received with a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7682 response. However, if a cache successfully validates a cache entry,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7683 it SHOULD remove any Warning headers previously attached to that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7684 entry except as specified for specific Warning codes. It MUST then
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7685 add any Warning headers received in the validating response. In other
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7686 words, Warning headers are those that would be attached to the most
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7687 recent relevant response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7688
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7689 When multiple Warning headers are attached to a response, the user
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7690 agent SHOULD display as many of them as possible, in the order that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7691 they appear in the response. If it is not possible to display all of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7692 the warnings, the user agent should follow these heuristics:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7693
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7694 o Warnings that appear early in the response take priority over those
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7695 appearing later in the response.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7696 o Warnings in the user's preferred character set take priority over
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7697 warnings in other character sets but with identical warn-codes and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7698 warn-agents.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7699
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7700 Systems that generate multiple Warning headers should order them with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7701 this user agent behavior in mind.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7702
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7703 This is a list of the currently-defined warn-codes, each with a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7704 recommended warn-text in English, and a description of its meaning.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7705
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7706 10 Response is stale
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7707 MUST be included whenever the returned response is stale. A cache may
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7708 add this warning to any response, but may never remove it until the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7709 response is known to be fresh.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7710
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7711 11 Revalidation failed
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7712 MUST be included if a cache returns a stale response because an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7713 attempt to revalidate the response failed, due to an inability to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7714 reach the server. A cache may add this warning to any response, but
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7715 may never remove it until the response is successfully revalidated.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7716
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7717 12 Disconnected operation
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7718 SHOULD be included if the cache is intentionally disconnected from
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7719 the rest of the network for a period of time.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7720
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7721 13 Heuristic expiration
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7722 MUST be included if the cache heuristically chose a freshness
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7723 lifetime greater than 24 hours and the response's age is greater than
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7724 24 hours.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7725
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7726
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7727
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7728
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7729
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7730 Fielding, et. al. Standards Track [Page 138]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7731
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7732 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7733
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7734
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7735 14 Transformation applied
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7736 MUST be added by an intermediate cache or proxy if it applies any
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7737 transformation changing the content-coding (as specified in the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7738 Content-Encoding header) or media-type (as specified in the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7739 Content-Type header) of the response, unless this Warning code
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7740 already appears in the response. MUST NOT be deleted from a response
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7741 even after revalidation.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7742
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7743 99 Miscellaneous warning
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7744 The warning text may include arbitrary information to be presented to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7745 a human user, or logged. A system receiving this warning MUST NOT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7746 take any automated action.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7747
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7748 14.46 WWW-Authenticate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7749
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7750 The WWW-Authenticate response-header field MUST be included in 401
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7751 (Unauthorized) response messages. The field value consists of at
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7752 least one challenge that indicates the authentication scheme(s) and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7753 parameters applicable to the Request-URI.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7754
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7755 WWW-Authenticate = "WWW-Authenticate" ":" 1#challenge
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7756
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7757 The HTTP access authentication process is described in section 11.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7758 User agents MUST take special care in parsing the WWW-Authenticate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7759 field value if it contains more than one challenge, or if more than
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7760 one WWW-Authenticate header field is provided, since the contents of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7761 a challenge may itself contain a comma-separated list of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7762 authentication parameters.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7763
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7764 15 Security Considerations
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7765
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7766 This section is meant to inform application developers, information
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7767 providers, and users of the security limitations in HTTP/1.1 as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7768 described by this document. The discussion does not include
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7769 definitive solutions to the problems revealed, though it does make
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7770 some suggestions for reducing security risks.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7771
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7772 15.1 Authentication of Clients
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7773
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7774 The Basic authentication scheme is not a secure method of user
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7775 authentication, nor does it in any way protect the entity, which is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7776 transmitted in clear text across the physical network used as the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7777 carrier. HTTP does not prevent additional authentication schemes and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7778 encryption mechanisms from being employed to increase security or the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7779 addition of enhancements (such as schemes to use one-time passwords)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7780 to Basic authentication.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7781
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7782
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7783
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7784
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7785
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7786 Fielding, et. al. Standards Track [Page 139]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7787
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7788 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7789
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7790
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7791 The most serious flaw in Basic authentication is that it results in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7792 the essentially clear text transmission of the user's password over
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7793 the physical network. It is this problem which Digest Authentication
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7794 attempts to address.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7795
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7796 Because Basic authentication involves the clear text transmission of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7797 passwords it SHOULD never be used (without enhancements) to protect
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7798 sensitive or valuable information.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7799
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7800 A common use of Basic authentication is for identification purposes
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7801 -- requiring the user to provide a user name and password as a means
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7802 of identification, for example, for purposes of gathering accurate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7803 usage statistics on a server. When used in this way it is tempting to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7804 think that there is no danger in its use if illicit access to the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7805 protected documents is not a major concern. This is only correct if
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7806 the server issues both user name and password to the users and in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7807 particular does not allow the user to choose his or her own password.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7808 The danger arises because naive users frequently reuse a single
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7809 password to avoid the task of maintaining multiple passwords.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7810
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7811 If a server permits users to select their own passwords, then the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7812 threat is not only illicit access to documents on the server but also
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7813 illicit access to the accounts of all users who have chosen to use
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7814 their account password. If users are allowed to choose their own
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7815 password that also means the server must maintain files containing
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7816 the (presumably encrypted) passwords. Many of these may be the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7817 account passwords of users perhaps at distant sites. The owner or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7818 administrator of such a system could conceivably incur liability if
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7819 this information is not maintained in a secure fashion.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7820
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7821 Basic Authentication is also vulnerable to spoofing by counterfeit
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7822 servers. If a user can be led to believe that he is connecting to a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7823 host containing information protected by basic authentication when in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7824 fact he is connecting to a hostile server or gateway then the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7825 attacker can request a password, store it for later use, and feign an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7826 error. This type of attack is not possible with Digest Authentication
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7827 [32]. Server implementers SHOULD guard against the possibility of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7828 this sort of counterfeiting by gateways or CGI scripts. In particular
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7829 it is very dangerous for a server to simply turn over a connection to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7830 a gateway since that gateway can then use the persistent connection
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7831 mechanism to engage in multiple transactions with the client while
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7832 impersonating the original server in a way that is not detectable by
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7833 the client.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7834
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7835 15.2 Offering a Choice of Authentication Schemes
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7836
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7837 An HTTP/1.1 server may return multiple challenges with a 401
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7838 (Authenticate) response, and each challenge may use a different
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7839
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7840
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7841
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7842 Fielding, et. al. Standards Track [Page 140]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7843
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7844 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7845
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7846
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7847 scheme. The order of the challenges returned to the user agent is in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7848 the order that the server would prefer they be chosen. The server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7849 should order its challenges with the "most secure" authentication
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7850 scheme first. A user agent should choose as the challenge to be made
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7851 to the user the first one that the user agent understands.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7852
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7853 When the server offers choices of authentication schemes using the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7854 WWW-Authenticate header, the "security" of the authentication is only
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7855 as malicious user could capture the set of challenges and try to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7856 authenticate him/herself using the weakest of the authentication
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7857 schemes. Thus, the ordering serves more to protect the user's
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7858 credentials than the server's information.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7859
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7860 A possible man-in-the-middle (MITM) attack would be to add a weak
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7861 authentication scheme to the set of choices, hoping that the client
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7862 will use one that exposes the user's credentials (e.g. password). For
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7863 this reason, the client should always use the strongest scheme that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7864 it understands from the choices accepted.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7865
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7866 An even better MITM attack would be to remove all offered choices,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7867 and to insert a challenge that requests Basic authentication. For
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7868 this reason, user agents that are concerned about this kind of attack
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7869 could remember the strongest authentication scheme ever requested by
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7870 a server and produce a warning message that requires user
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7871 confirmation before using a weaker one. A particularly insidious way
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7872 to mount such a MITM attack would be to offer a "free" proxy caching
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7873 service to gullible users.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7874
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7875 15.3 Abuse of Server Log Information
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7876
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7877 A server is in the position to save personal data about a user's
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7878 requests which may identify their reading patterns or subjects of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7879 interest. This information is clearly confidential in nature and its
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7880 handling may be constrained by law in certain countries. People using
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7881 the HTTP protocol to provide data are responsible for ensuring that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7882 such material is not distributed without the permission of any
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7883 individuals that are identifiable by the published results.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7884
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7885 15.4 Transfer of Sensitive Information
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7886
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7887 Like any generic data transfer protocol, HTTP cannot regulate the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7888 content of the data that is transferred, nor is there any a priori
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7889 method of determining the sensitivity of any particular piece of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7890 information within the context of any given request. Therefore,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7891 applications SHOULD supply as much control over this information as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7892 possible to the provider of that information. Four header fields are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7893 worth special mention in this context: Server, Via, Referer and From.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7894
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7895
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7896
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7897
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7898 Fielding, et. al. Standards Track [Page 141]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7899
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7900 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7901
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7902
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7903 Revealing the specific software version of the server may allow the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7904 server machine to become more vulnerable to attacks against software
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7905 that is known to contain security holes. Implementers SHOULD make the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7906 Server header field a configurable option.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7907
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7908 Proxies which serve as a portal through a network firewall SHOULD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7909 take special precautions regarding the transfer of header information
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7910 that identifies the hosts behind the firewall. In particular, they
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7911 SHOULD remove, or replace with sanitized versions, any Via fields
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7912 generated behind the firewall.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7913
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7914 The Referer field allows reading patterns to be studied and reverse
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7915 links drawn. Although it can be very useful, its power can be abused
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7916 if user details are not separated from the information contained in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7917 the Referer. Even when the personal information has been removed, the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7918 Referer field may indicate a private document's URI whose publication
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7919 would be inappropriate.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7920
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7921 The information sent in the From field might conflict with the user's
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7922 privacy interests or their site's security policy, and hence it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7923 SHOULD NOT be transmitted without the user being able to disable,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7924 enable, and modify the contents of the field. The user MUST be able
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7925 to set the contents of this field within a user preference or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7926 application defaults configuration.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7927
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7928 We suggest, though do not require, that a convenient toggle interface
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7929 be provided for the user to enable or disable the sending of From and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7930 Referer information.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7931
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7932 15.5 Attacks Based On File and Path Names
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7933
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7934 Implementations of HTTP origin servers SHOULD be careful to restrict
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7935 the documents returned by HTTP requests to be only those that were
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7936 intended by the server administrators. If an HTTP server translates
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7937 HTTP URIs directly into file system calls, the server MUST take
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7938 special care not to serve files that were not intended to be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7939 delivered to HTTP clients. For example, UNIX, Microsoft Windows, and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7940 other operating systems use ".." as a path component to indicate a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7941 directory level above the current one. On such a system, an HTTP
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7942 server MUST disallow any such construct in the Request-URI if it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7943 would otherwise allow access to a resource outside those intended to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7944 be accessible via the HTTP server. Similarly, files intended for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7945 reference only internally to the server (such as access control
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7946 files, configuration files, and script code) MUST be protected from
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7947 inappropriate retrieval, since they might contain sensitive
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7948 information. Experience has shown that minor bugs in such HTTP server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7949 implementations have turned into security risks.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7950
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7951
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7952
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7953
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7954 Fielding, et. al. Standards Track [Page 142]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7955
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7956 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7957
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7958
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7959 15.6 Personal Information
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7960
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7961 HTTP clients are often privy to large amounts of personal information
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7962 (e.g. the user's name, location, mail address, passwords, encryption
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7963 keys, etc.), and SHOULD be very careful to prevent unintentional
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7964 leakage of this information via the HTTP protocol to other sources.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7965 We very strongly recommend that a convenient interface be provided
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7966 for the user to control dissemination of such information, and that
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7967 designers and implementers be particularly careful in this area.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7968 History shows that errors in this area are often both serious
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7969 security and/or privacy problems, and often generate highly adverse
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7970 publicity for the implementer's company.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7971
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7972 15.7 Privacy Issues Connected to Accept Headers
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7973
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7974 Accept request-headers can reveal information about the user to all
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7975 servers which are accessed. The Accept-Language header in particular
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7976 can reveal information the user would consider to be of a private
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7977 nature, because the understanding of particular languages is often
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7978 strongly correlated to the membership of a particular ethnic group.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7979 User agents which offer the option to configure the contents of an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7980 Accept-Language header to be sent in every request are strongly
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7981 encouraged to let the configuration process include a message which
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7982 makes the user aware of the loss of privacy involved.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7983
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7984 An approach that limits the loss of privacy would be for a user agent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7985 to omit the sending of Accept-Language headers by default, and to ask
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7986 the user whether it should start sending Accept-Language headers to a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7987 server if it detects, by looking for any Vary response-header fields
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7988 generated by the server, that such sending could improve the quality
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7989 of service.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7990
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7991 Elaborate user-customized accept header fields sent in every request,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7992 in particular if these include quality values, can be used by servers
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7993 as relatively reliable and long-lived user identifiers. Such user
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7994 identifiers would allow content providers to do click-trail tracking,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7995 and would allow collaborating content providers to match cross-server
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7996 click-trails or form submissions of individual users. Note that for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7997 many users not behind a proxy, the network address of the host
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7998 running the user agent will also serve as a long-lived user
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7999 identifier. In environments where proxies are used to enhance
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8000 privacy, user agents should be conservative in offering accept header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8001 configuration options to end users. As an extreme privacy measure,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8002 proxies could filter the accept headers in relayed requests. General
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8003 purpose user agents which provide a high degree of header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8004 configurability should warn users about the loss of privacy which can
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8005 be involved.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8006
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8007
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8008
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8009
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8010 Fielding, et. al. Standards Track [Page 143]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8011
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8012 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8013
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8014
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8015 15.8 DNS Spoofing
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8016
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8017 Clients using HTTP rely heavily on the Domain Name Service, and are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8018 thus generally prone to security attacks based on the deliberate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8019 mis-association of IP addresses and DNS names. Clients need to be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8020 cautious in assuming the continuing validity of an IP number/DNS name
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8021 association.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8022
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8023 In particular, HTTP clients SHOULD rely on their name resolver for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8024 confirmation of an IP number/DNS name association, rather than
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8025 caching the result of previous host name lookups. Many platforms
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8026 already can cache host name lookups locally when appropriate, and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8027 they SHOULD be configured to do so. These lookups should be cached,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8028 however, only when the TTL (Time To Live) information reported by the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8029 name server makes it likely that the cached information will remain
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8030 useful.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8031
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8032 If HTTP clients cache the results of host name lookups in order to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8033 achieve a performance improvement, they MUST observe the TTL
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8034 information reported by DNS.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8035
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8036 If HTTP clients do not observe this rule, they could be spoofed when
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8037 a previously-accessed server's IP address changes. As network
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8038 renumbering is expected to become increasingly common, the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8039 possibility of this form of attack will grow. Observing this
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8040 requirement thus reduces this potential security vulnerability.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8041
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8042 This requirement also improves the load-balancing behavior of clients
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8043 for replicated servers using the same DNS name and reduces the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8044 likelihood of a user's experiencing failure in accessing sites which
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8045 use that strategy.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8046
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8047 15.9 Location Headers and Spoofing
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8048
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8049 If a single server supports multiple organizations that do not trust
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8050 one another, then it must check the values of Location and Content-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8051 Location headers in responses that are generated under control of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8052 said organizations to make sure that they do not attempt to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8053 invalidate resources over which they have no authority.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8054
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8055 16 Acknowledgments
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8056
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8057 This specification makes heavy use of the augmented BNF and generic
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8058 constructs defined by David H. Crocker for RFC 822. Similarly, it
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8059 reuses many of the definitions provided by Nathaniel Borenstein and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8060 Ned Freed for MIME. We hope that their inclusion in this
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8061 specification will help reduce past confusion over the relationship
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8062 between HTTP and Internet mail message formats.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8063
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8064
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8065
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8066 Fielding, et. al. Standards Track [Page 144]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8067
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8068 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8069
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8070
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8071 The HTTP protocol has evolved considerably over the past four years.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8072 It has benefited from a large and active developer community--the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8073 many people who have participated on the www-talk mailing list--and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8074 it is that community which has been most responsible for the success
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8075 of HTTP and of the World-Wide Web in general. Marc Andreessen, Robert
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8076 Cailliau, Daniel W. Connolly, Bob Denny, John Franks, Jean-Francois
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8077 Groff, Phillip M. Hallam-Baker, Hakon W. Lie, Ari Luotonen, Rob
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8078 McCool, Lou Montulli, Dave Raggett, Tony Sanders, and Marc
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8079 VanHeyningen deserve special recognition for their efforts in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8080 defining early aspects of the protocol.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8081
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8082 This document has benefited greatly from the comments of all those
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8083 participating in the HTTP-WG. In addition to those already mentioned,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8084 the following individuals have contributed to this specification:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8085
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8086 Gary Adams Albert Lunde
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8087 Harald Tveit Alvestrand John C. Mallery
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8088 Keith Ball Jean-Philippe Martin-Flatin
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8089 Brian Behlendorf Larry Masinter
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8090 Paul Burchard Mitra
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8091 Maurizio Codogno David Morris
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8092 Mike Cowlishaw Gavin Nicol
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8093 Roman Czyborra Bill Perry
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8094 Michael A. Dolan Jeffrey Perry
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8095 David J. Fiander Scott Powers
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8096 Alan Freier Owen Rees
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8097 Marc Hedlund Luigi Rizzo
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8098 Greg Herlihy David Robinson
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8099 Koen Holtman Marc Salomon
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8100 Alex Hopmann Rich Salz
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8101 Bob Jernigan Allan M. Schiffman
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8102 Shel Kaphan Jim Seidman
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8103 Rohit Khare Chuck Shotton
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8104 John Klensin Eric W. Sink
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8105 Martijn Koster Simon E. Spero
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8106 Alexei Kosut Richard N. Taylor
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8107 David M. Kristol Robert S. Thau
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8108 Daniel LaLiberte Bill (BearHeart) Weinman
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8109 Ben Laurie Francois Yergeau
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8110 Paul J. Leach Mary Ellen Zurko
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8111 Daniel DuBois
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8112
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8113 Much of the content and presentation of the caching design is due to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8114 suggestions and comments from individuals including: Shel Kaphan,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8115 Paul Leach, Koen Holtman, David Morris, and Larry Masinter.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8116
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8117
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8118
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8119
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8120
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8121
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8122 Fielding, et. al. Standards Track [Page 145]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8123
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8124 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8125
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8126
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8127 Most of the specification of ranges is based on work originally done
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8128 by Ari Luotonen and John Franks, with additional input from Steve
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8129 Zilles.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8130
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8131 Thanks to the "cave men" of Palo Alto. You know who you are.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8132
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8133 Jim Gettys (the current editor of this document) wishes particularly
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8134 to thank Roy Fielding, the previous editor of this document, along
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8135 with John Klensin, Jeff Mogul, Paul Leach, Dave Kristol, Koen
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8136 Holtman, John Franks, Alex Hopmann, and Larry Masinter for their
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8137 help.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8138
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8139 17 References
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8140
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8141 [1] Alvestrand, H., "Tags for the identification of languages", RFC
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8142 1766, UNINETT, March 1995.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8143
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8144 [2] Anklesaria, F., McCahill, M., Lindner, P., Johnson, D., Torrey,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8145 D., and B. Alberti. "The Internet Gopher Protocol: (a distributed
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8146 document search and retrieval protocol)", RFC 1436, University of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8147 Minnesota, March 1993.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8148
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8149 [3] Berners-Lee, T., "Universal Resource Identifiers in WWW", A
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8150 Unifying Syntax for the Expression of Names and Addresses of Objects
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8151 on the Network as used in the World-Wide Web", RFC 1630, CERN, June
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8152 1994.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8153
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8154 [4] Berners-Lee, T., Masinter, L., and M. McCahill, "Uniform Resource
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8155 Locators (URL)", RFC 1738, CERN, Xerox PARC, University of Minnesota,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8156 December 1994.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8157
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8158 [5] Berners-Lee, T., and D. Connolly, "HyperText Markup Language
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8159 Specification - 2.0", RFC 1866, MIT/LCS, November 1995.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8160
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8161 [6] Berners-Lee, T., Fielding, R., and H. Frystyk, "Hypertext
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8162 Transfer Protocol -- HTTP/1.0.", RFC 1945 MIT/LCS, UC Irvine, May
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8163 1996.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8164
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8165 [7] Freed, N., and N. Borenstein, "Multipurpose Internet Mail
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8166 Extensions (MIME) Part One: Format of Internet Message Bodies", RFC
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8167 2045, Innosoft, First Virtual, November 1996.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8168
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8169 [8] Braden, R., "Requirements for Internet hosts - application and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8170 support", STD 3, RFC 1123, IETF, October 1989.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8171
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8172 [9] Crocker, D., "Standard for the Format of ARPA Internet Text
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8173 Messages", STD 11, RFC 822, UDEL, August 1982.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8174
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8175
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8176
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8177
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8178 Fielding, et. al. Standards Track [Page 146]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8179
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8180 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8181
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8182
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8183 [10] Davis, F., Kahle, B., Morris, H., Salem, J., Shen, T., Wang, R.,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8184 Sui, J., and M. Grinbaum. "WAIS Interface Protocol Prototype
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8185 Functional Specification", (v1.5), Thinking Machines Corporation,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8186 April 1990.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8187
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8188 [11] Fielding, R., "Relative Uniform Resource Locators", RFC 1808, UC
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8189 Irvine, June 1995.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8190
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8191 [12] Horton, M., and R. Adams. "Standard for interchange of USENET
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8192 messages", RFC 1036, AT&T Bell Laboratories, Center for Seismic
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8193 Studies, December 1987.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8194
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8195 [13] Kantor, B., and P. Lapsley. "Network News Transfer Protocol." A
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8196 Proposed Standard for the Stream-Based Transmission of News", RFC
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8197 977, UC San Diego, UC Berkeley, February 1986.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8198
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8199 [14] Moore, K., "MIME (Multipurpose Internet Mail Extensions) Part
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8200 Three: Message Header Extensions for Non-ASCII Text", RFC 2047,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8201 University of Tennessee, November 1996.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8202
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8203 [15] Nebel, E., and L. Masinter. "Form-based File Upload in HTML",
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8204 RFC 1867, Xerox Corporation, November 1995.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8205
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8206 [16] Postel, J., "Simple Mail Transfer Protocol", STD 10, RFC 821,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8207 USC/ISI, August 1982.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8208
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8209 [17] Postel, J., "Media Type Registration Procedure", RFC 2048,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8210 USC/ISI, November 1996.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8211
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8212 [18] Postel, J., and J. Reynolds, "File Transfer Protocol (FTP)", STD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8213 9, RFC 959, USC/ISI, October 1985.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8214
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8215 [19] Reynolds, J., and J. Postel, "Assigned Numbers", STD 2, RFC
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8216 1700, USC/ISI, October 1994.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8217
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8218 [20] Sollins, K., and L. Masinter, "Functional Requirements for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8219 Uniform Resource Names", RFC 1737, MIT/LCS, Xerox Corporation,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8220 December 1994.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8221
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8222 [21] US-ASCII. Coded Character Set - 7-Bit American Standard Code for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8223 Information Interchange. Standard ANSI X3.4-1986, ANSI, 1986.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8224
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8225 [22] ISO-8859. International Standard -- Information Processing --
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8226 8-bit Single-Byte Coded Graphic Character Sets --
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8227 Part 1: Latin alphabet No. 1, ISO 8859-1:1987.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8228 Part 2: Latin alphabet No. 2, ISO 8859-2, 1987.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8229 Part 3: Latin alphabet No. 3, ISO 8859-3, 1988.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8230 Part 4: Latin alphabet No. 4, ISO 8859-4, 1988.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8231
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8232
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8233
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8234 Fielding, et. al. Standards Track [Page 147]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8235
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8236 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8237
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8238
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8239 Part 5: Latin/Cyrillic alphabet, ISO 8859-5, 1988.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8240 Part 6: Latin/Arabic alphabet, ISO 8859-6, 1987.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8241 Part 7: Latin/Greek alphabet, ISO 8859-7, 1987.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8242 Part 8: Latin/Hebrew alphabet, ISO 8859-8, 1988.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8243 Part 9: Latin alphabet No. 5, ISO 8859-9, 1990.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8244
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8245 [23] Meyers, J., and M. Rose "The Content-MD5 Header Field", RFC
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8246 1864, Carnegie Mellon, Dover Beach Consulting, October, 1995.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8247
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8248 [24] Carpenter, B., and Y. Rekhter, "Renumbering Needs Work", RFC
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8249 1900, IAB, February 1996.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8250
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8251 [25] Deutsch, P., "GZIP file format specification version 4.3." RFC
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8252 1952, Aladdin Enterprises, May 1996.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8253
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8254 [26] Venkata N. Padmanabhan and Jeffrey C. Mogul. Improving HTTP
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8255 Latency. Computer Networks and ISDN Systems, v. 28, pp. 25-35, Dec.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8256 1995. Slightly revised version of paper in Proc. 2nd International
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8257 WWW Conf. '94: Mosaic and the Web, Oct. 1994, which is available at
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8258 http://www.ncsa.uiuc.edu/SDG/IT94/Proceedings/DDay/mogul/
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8259 HTTPLatency.html.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8260
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8261 [27] Joe Touch, John Heidemann, and Katia Obraczka, "Analysis of HTTP
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8262 Performance", <URL: http://www.isi.edu/lsam/ib/http-perf/>,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8263 USC/Information Sciences Institute, June 1996
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8264
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8265 [28] Mills, D., "Network Time Protocol, Version 3, Specification,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8266 Implementation and Analysis", RFC 1305, University of Delaware, March
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8267 1992.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8268
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8269 [29] Deutsch, P., "DEFLATE Compressed Data Format Specification
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8270 version 1.3." RFC 1951, Aladdin Enterprises, May 1996.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8271
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8272 [30] Spero, S., "Analysis of HTTP Performance Problems"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8273 <URL:http://sunsite.unc.edu/mdma-release/http-prob.html>.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8274
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8275 [31] Deutsch, P., and J-L. Gailly, "ZLIB Compressed Data Format
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8276 Specification version 3.3", RFC 1950, Aladdin Enterprises, Info-ZIP,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8277 May 1996.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8278
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8279 [32] Franks, J., Hallam-Baker, P., Hostetler, J., Leach, P.,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8280 Luotonen, A., Sink, E., and L. Stewart, "An Extension to HTTP :
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8281 Digest Access Authentication", RFC 2069, January 1997.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8282
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8283
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8284
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8285
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8286
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8287
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8288
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8289
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8290 Fielding, et. al. Standards Track [Page 148]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8291
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8292 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8293
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8294
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8295 18 Authors' Addresses
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8296
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8297 Roy T. Fielding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8298 Department of Information and Computer Science
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8299 University of California
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8300 Irvine, CA 92717-3425, USA
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8301
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8302 Fax: +1 (714) 824-4056
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8303 EMail: fielding@ics.uci.edu
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8304
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8305
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8306 Jim Gettys
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8307 MIT Laboratory for Computer Science
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8308 545 Technology Square
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8309 Cambridge, MA 02139, USA
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8310
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8311 Fax: +1 (617) 258 8682
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8312 EMail: jg@w3.org
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8313
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8314
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8315 Jeffrey C. Mogul
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8316 Western Research Laboratory
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8317 Digital Equipment Corporation
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8318 250 University Avenue
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8319 Palo Alto, California, 94305, USA
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8320
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8321 EMail: mogul@wrl.dec.com
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8322
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8323
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8324 Henrik Frystyk Nielsen
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8325 W3 Consortium
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8326 MIT Laboratory for Computer Science
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8327 545 Technology Square
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8328 Cambridge, MA 02139, USA
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8329
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8330 Fax: +1 (617) 258 8682
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8331 EMail: frystyk@w3.org
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8332
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8333
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8334 Tim Berners-Lee
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8335 Director, W3 Consortium
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8336 MIT Laboratory for Computer Science
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8337 545 Technology Square
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8338 Cambridge, MA 02139, USA
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8339
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8340 Fax: +1 (617) 258 8682
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8341 EMail: timbl@w3.org
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8342
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8343
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8344
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8345
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8346 Fielding, et. al. Standards Track [Page 149]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8347
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8348 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8349
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8350
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8351 19 Appendices
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8352
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8353 19.1 Internet Media Type message/http
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8354
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8355 In addition to defining the HTTP/1.1 protocol, this document serves
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8356 as the specification for the Internet media type "message/http". The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8357 following is to be registered with IANA.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8358
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8359 Media Type name: message
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8360 Media subtype name: http
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8361 Required parameters: none
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8362 Optional parameters: version, msgtype
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8363
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8364 version: The HTTP-Version number of the enclosed message
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8365 (e.g., "1.1"). If not present, the version can be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8366 determined from the first line of the body.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8367
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8368 msgtype: The message type -- "request" or "response". If not
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8369 present, the type can be determined from the first
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8370 line of the body.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8371
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8372 Encoding considerations: only "7bit", "8bit", or "binary" are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8373 permitted
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8374
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8375 Security considerations: none
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8376
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8377 19.2 Internet Media Type multipart/byteranges
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8378
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8379 When an HTTP message includes the content of multiple ranges (for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8380 example, a response to a request for multiple non-overlapping
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8381 ranges), these are transmitted as a multipart MIME message. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8382 multipart media type for this purpose is called
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8383 "multipart/byteranges".
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8384
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8385 The multipart/byteranges media type includes two or more parts, each
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8386 with its own Content-Type and Content-Range fields. The parts are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8387 separated using a MIME boundary parameter.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8388
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8389 Media Type name: multipart
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8390 Media subtype name: byteranges
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8391 Required parameters: boundary
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8392 Optional parameters: none
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8393
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8394 Encoding considerations: only "7bit", "8bit", or "binary" are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8395 permitted
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8396
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8397 Security considerations: none
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8398
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8399
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8400
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8401
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8402 Fielding, et. al. Standards Track [Page 150]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8403
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8404 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8405
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8406
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8407 For example:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8408
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8409 HTTP/1.1 206 Partial content
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8410 Date: Wed, 15 Nov 1995 06:25:24 GMT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8411 Last-modified: Wed, 15 Nov 1995 04:58:08 GMT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8412 Content-type: multipart/byteranges; boundary=THIS_STRING_SEPARATES
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8413
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8414 --THIS_STRING_SEPARATES
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8415 Content-type: application/pdf
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8416 Content-range: bytes 500-999/8000
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8417
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8418 ...the first range...
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8419 --THIS_STRING_SEPARATES
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8420 Content-type: application/pdf
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8421 Content-range: bytes 7000-7999/8000
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8422
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8423 ...the second range
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8424 --THIS_STRING_SEPARATES--
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8425
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8426 19.3 Tolerant Applications
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8427
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8428 Although this document specifies the requirements for the generation
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8429 of HTTP/1.1 messages, not all applications will be correct in their
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8430 implementation. We therefore recommend that operational applications
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8431 be tolerant of deviations whenever those deviations can be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8432 interpreted unambiguously.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8433
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8434 Clients SHOULD be tolerant in parsing the Status-Line and servers
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8435 tolerant when parsing the Request-Line. In particular, they SHOULD
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8436 accept any amount of SP or HT characters between fields, even though
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8437 only a single SP is required.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8438
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8439 The line terminator for message-header fields is the sequence CRLF.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8440 However, we recommend that applications, when parsing such headers,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8441 recognize a single LF as a line terminator and ignore the leading CR.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8442
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8443 The character set of an entity-body should be labeled as the lowest
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8444 common denominator of the character codes used within that body, with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8445 the exception that no label is preferred over the labels US-ASCII or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8446 ISO-8859-1.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8447
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8448 Additional rules for requirements on parsing and encoding of dates
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8449 and other potential problems with date encodings include:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8450
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8451 o HTTP/1.1 clients and caches should assume that an RFC-850 date
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8452 which appears to be more than 50 years in the future is in fact
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8453 in the past (this helps solve the "year 2000" problem).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8454
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8455
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8456
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8457
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8458 Fielding, et. al. Standards Track [Page 151]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8459
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8460 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8461
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8462
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8463 o An HTTP/1.1 implementation may internally represent a parsed
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8464 Expires date as earlier than the proper value, but MUST NOT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8465 internally represent a parsed Expires date as later than the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8466 proper value.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8467
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8468 o All expiration-related calculations must be done in GMT. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8469 local time zone MUST NOT influence the calculation or comparison
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8470 of an age or expiration time.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8471
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8472 o If an HTTP header incorrectly carries a date value with a time
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8473 zone other than GMT, it must be converted into GMT using the most
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8474 conservative possible conversion.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8475
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8476 19.4 Differences Between HTTP Entities and MIME Entities
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8477
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8478 HTTP/1.1 uses many of the constructs defined for Internet Mail (RFC
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8479 822) and the Multipurpose Internet Mail Extensions (MIME ) to allow
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8480 entities to be transmitted in an open variety of representations and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8481 with extensible mechanisms. However, MIME [7] discusses mail, and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8482 HTTP has a few features that are different from those described in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8483 MIME. These differences were carefully chosen to optimize
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8484 performance over binary connections, to allow greater freedom in the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8485 use of new media types, to make date comparisons easier, and to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8486 acknowledge the practice of some early HTTP servers and clients.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8487
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8488 This appendix describes specific areas where HTTP differs from MIME.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8489 Proxies and gateways to strict MIME environments SHOULD be aware of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8490 these differences and provide the appropriate conversions where
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8491 necessary. Proxies and gateways from MIME environments to HTTP also
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8492 need to be aware of the differences because some conversions may be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8493 required.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8494
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8495 19.4.1 Conversion to Canonical Form
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8496
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8497 MIME requires that an Internet mail entity be converted to canonical
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8498 form prior to being transferred. Section 3.7.1 of this document
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8499 describes the forms allowed for subtypes of the "text" media type
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8500 when transmitted over HTTP. MIME requires that content with a type of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8501 "text" represent line breaks as CRLF and forbids the use of CR or LF
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8502 outside of line break sequences. HTTP allows CRLF, bare CR, and bare
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8503 LF to indicate a line break within text content when a message is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8504 transmitted over HTTP.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8505
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8506 Where it is possible, a proxy or gateway from HTTP to a strict MIME
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8507 environment SHOULD translate all line breaks within the text media
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8508 types described in section 3.7.1 of this document to the MIME
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8509 canonical form of CRLF. Note, however, that this may be complicated
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8510 by the presence of a Content-Encoding and by the fact that HTTP
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8511
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8512
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8513
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8514 Fielding, et. al. Standards Track [Page 152]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8515
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8516 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8517
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8518
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8519 allows the use of some character sets which do not use octets 13 and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8520 10 to represent CR and LF, as is the case for some multi-byte
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8521 character sets.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8522
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8523 19.4.2 Conversion of Date Formats
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8524
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8525 HTTP/1.1 uses a restricted set of date formats (section 3.3.1) to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8526 simplify the process of date comparison. Proxies and gateways from
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8527 other protocols SHOULD ensure that any Date header field present in a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8528 message conforms to one of the HTTP/1.1 formats and rewrite the date
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8529 if necessary.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8530
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8531 19.4.3 Introduction of Content-Encoding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8532
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8533 MIME does not include any concept equivalent to HTTP/1.1's Content-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8534 Encoding header field. Since this acts as a modifier on the media
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8535 type, proxies and gateways from HTTP to MIME-compliant protocols MUST
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8536 either change the value of the Content-Type header field or decode
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8537 the entity-body before forwarding the message. (Some experimental
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8538 applications of Content-Type for Internet mail have used a media-type
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8539 parameter of ";conversions=<content-coding>" to perform an equivalent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8540 function as Content-Encoding. However, this parameter is not part of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8541 MIME.)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8542
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8543 19.4.4 No Content-Transfer-Encoding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8544
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8545 HTTP does not use the Content-Transfer-Encoding (CTE) field of MIME.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8546 Proxies and gateways from MIME-compliant protocols to HTTP MUST
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8547 remove any non-identity CTE ("quoted-printable" or "base64") encoding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8548 prior to delivering the response message to an HTTP client.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8549
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8550 Proxies and gateways from HTTP to MIME-compliant protocols are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8551 responsible for ensuring that the message is in the correct format
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8552 and encoding for safe transport on that protocol, where "safe
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8553 transport" is defined by the limitations of the protocol being used.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8554 Such a proxy or gateway SHOULD label the data with an appropriate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8555 Content-Transfer-Encoding if doing so will improve the likelihood of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8556 safe transport over the destination protocol.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8557
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8558 19.4.5 HTTP Header Fields in Multipart Body-Parts
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8559
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8560 In MIME, most header fields in multipart body-parts are generally
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8561 ignored unless the field name begins with "Content-". In HTTP/1.1,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8562 multipart body-parts may contain any HTTP header fields which are
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8563 significant to the meaning of that part.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8564
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8565
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8566
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8567
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8568
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8569
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8570 Fielding, et. al. Standards Track [Page 153]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8571
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8572 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8573
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8574
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8575 19.4.6 Introduction of Transfer-Encoding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8576
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8577 HTTP/1.1 introduces the Transfer-Encoding header field (section
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8578 14.40). Proxies/gateways MUST remove any transfer coding prior to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8579 forwarding a message via a MIME-compliant protocol.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8580
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8581 A process for decoding the "chunked" transfer coding (section 3.6)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8582 can be represented in pseudo-code as:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8583
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8584 length := 0
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8585 read chunk-size, chunk-ext (if any) and CRLF
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8586 while (chunk-size > 0) {
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8587 read chunk-data and CRLF
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8588 append chunk-data to entity-body
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8589 length := length + chunk-size
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8590 read chunk-size and CRLF
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8591 }
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8592 read entity-header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8593 while (entity-header not empty) {
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8594 append entity-header to existing header fields
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8595 read entity-header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8596 }
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8597 Content-Length := length
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8598 Remove "chunked" from Transfer-Encoding
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8599
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8600 19.4.7 MIME-Version
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8601
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8602 HTTP is not a MIME-compliant protocol (see appendix 19.4). However,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8603 HTTP/1.1 messages may include a single MIME-Version general-header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8604 field to indicate what version of the MIME protocol was used to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8605 construct the message. Use of the MIME-Version header field indicates
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8606 that the message is in full compliance with the MIME protocol.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8607 Proxies/gateways are responsible for ensuring full compliance (where
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8608 possible) when exporting HTTP messages to strict MIME environments.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8609
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8610 MIME-Version = "MIME-Version" ":" 1*DIGIT "." 1*DIGIT
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8611
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8612 MIME version "1.0" is the default for use in HTTP/1.1. However,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8613 HTTP/1.1 message parsing and semantics are defined by this document
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8614 and not the MIME specification.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8615
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8616 19.5 Changes from HTTP/1.0
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8617
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8618 This section summarizes major differences between versions HTTP/1.0
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8619 and HTTP/1.1.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8620
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8621
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8622
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8623
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8624
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8625
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8626 Fielding, et. al. Standards Track [Page 154]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8627
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8628 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8629
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8630
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8631 19.5.1 Changes to Simplify Multi-homed Web Servers and Conserve IP
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8632 Addresses
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8633
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8634 The requirements that clients and servers support the Host request-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8635 header, report an error if the Host request-header (section 14.23) is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8636 missing from an HTTP/1.1 request, and accept absolute URIs (section
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8637 5.1.2) are among the most important changes defined by this
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8638 specification.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8639
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8640 Older HTTP/1.0 clients assumed a one-to-one relationship of IP
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8641 addresses and servers; there was no other established mechanism for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8642 distinguishing the intended server of a request than the IP address
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8643 to which that request was directed. The changes outlined above will
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8644 allow the Internet, once older HTTP clients are no longer common, to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8645 support multiple Web sites from a single IP address, greatly
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8646 simplifying large operational Web servers, where allocation of many
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8647 IP addresses to a single host has created serious problems. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8648 Internet will also be able to recover the IP addresses that have been
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8649 allocated for the sole purpose of allowing special-purpose domain
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8650 names to be used in root-level HTTP URLs. Given the rate of growth of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8651 the Web, and the number of servers already deployed, it is extremely
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8652 important that all implementations of HTTP (including updates to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8653 existing HTTP/1.0 applications) correctly implement these
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8654 requirements:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8655
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8656 o Both clients and servers MUST support the Host request-header.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8657
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8658 o Host request-headers are required in HTTP/1.1 requests.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8659
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8660 o Servers MUST report a 400 (Bad Request) error if an HTTP/1.1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8661 request does not include a Host request-header.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8662
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8663 o Servers MUST accept absolute URIs.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8664
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8665
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8666
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8667
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8668
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8669
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8670
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8671
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8672
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8673
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8674
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8675
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8676
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8677
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8678
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8679
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8680
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8681
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8682 Fielding, et. al. Standards Track [Page 155]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8683
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8684 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8685
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8686
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8687 19.6 Additional Features
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8688
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8689 This appendix documents protocol elements used by some existing HTTP
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8690 implementations, but not consistently and correctly across most
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8691 HTTP/1.1 applications. Implementers should be aware of these
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8692 features, but cannot rely upon their presence in, or interoperability
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8693 with, other HTTP/1.1 applications. Some of these describe proposed
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8694 experimental features, and some describe features that experimental
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8695 deployment found lacking that are now addressed in the base HTTP/1.1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8696 specification.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8697
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8698 19.6.1 Additional Request Methods
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8699
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8700 19.6.1.1 PATCH
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8701
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8702 The PATCH method is similar to PUT except that the entity contains a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8703 list of differences between the original version of the resource
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8704 identified by the Request-URI and the desired content of the resource
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8705 after the PATCH action has been applied. The list of differences is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8706 in a format defined by the media type of the entity (e.g.,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8707 "application/diff") and MUST include sufficient information to allow
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8708 the server to recreate the changes necessary to convert the original
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8709 version of the resource to the desired version.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8710
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8711 If the request passes through a cache and the Request-URI identifies
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8712 a currently cached entity, that entity MUST be removed from the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8713 cache. Responses to this method are not cachable.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8714
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8715 The actual method for determining how the patched resource is placed,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8716 and what happens to its predecessor, is defined entirely by the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8717 origin server. If the original version of the resource being patched
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8718 included a Content-Version header field, the request entity MUST
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8719 include a Derived-From header field corresponding to the value of the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8720 original Content-Version header field. Applications are encouraged to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8721 use these fields for constructing versioning relationships and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8722 resolving version conflicts.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8723
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8724 PATCH requests must obey the message transmission requirements set
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8725 out in section 8.2.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8726
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8727 Caches that implement PATCH should invalidate cached responses as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8728 defined in section 13.10 for PUT.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8729
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8730 19.6.1.2 LINK
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8731
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8732 The LINK method establishes one or more Link relationships between
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8733 the existing resource identified by the Request-URI and other
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8734 existing resources. The difference between LINK and other methods
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8735
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8736
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8737
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8738 Fielding, et. al. Standards Track [Page 156]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8739
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8740 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8741
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8742
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8743 allowing links to be established between resources is that the LINK
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8744 method does not allow any message-body to be sent in the request and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8745 does not directly result in the creation of new resources.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8746
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8747 If the request passes through a cache and the Request-URI identifies
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8748 a currently cached entity, that entity MUST be removed from the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8749 cache. Responses to this method are not cachable.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8750
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8751 Caches that implement LINK should invalidate cached responses as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8752 defined in section 13.10 for PUT.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8753
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8754 19.6.1.3 UNLINK
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8755
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8756 The UNLINK method removes one or more Link relationships from the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8757 existing resource identified by the Request-URI. These relationships
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8758 may have been established using the LINK method or by any other
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8759 method supporting the Link header. The removal of a link to a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8760 resource does not imply that the resource ceases to exist or becomes
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8761 inaccessible for future references.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8762
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8763 If the request passes through a cache and the Request-URI identifies
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8764 a currently cached entity, that entity MUST be removed from the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8765 cache. Responses to this method are not cachable.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8766
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8767 Caches that implement UNLINK should invalidate cached responses as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8768 defined in section 13.10 for PUT.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8769
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8770 19.6.2 Additional Header Field Definitions
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8771
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8772 19.6.2.1 Alternates
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8773
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8774 The Alternates response-header field has been proposed as a means for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8775 the origin server to inform the client about other available
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8776 representations of the requested resource, along with their
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8777 distinguishing attributes, and thus providing a more reliable means
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8778 for a user agent to perform subsequent selection of another
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8779 representation which better fits the desires of its user (described
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8780 as agent-driven negotiation in section 12).
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8781
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8782
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8783
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8784
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8785
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8786
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8787
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8788
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8789
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8790
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8791
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8792
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8793
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8794 Fielding, et. al. Standards Track [Page 157]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8795
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8796 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8797
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8798
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8799 The Alternates header field is orthogonal to the Vary header field in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8800 that both may coexist in a message without affecting the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8801 interpretation of the response or the available representations. It
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8802 is expected that Alternates will provide a significant improvement
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8803 over the server-driven negotiation provided by the Vary field for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8804 those resources that vary over common dimensions like type and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8805 language.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8806
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8807 The Alternates header field will be defined in a future
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8808 specification.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8809
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8810 19.6.2.2 Content-Version
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8811
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8812 The Content-Version entity-header field defines the version tag
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8813 associated with a rendition of an evolving entity. Together with the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8814 Derived-From field described in section 19.6.2.3, it allows a group
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8815 of people to work simultaneously on the creation of a work as an
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8816 iterative process. The field should be used to allow evolution of a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8817 particular work along a single path rather than derived works or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8818 renditions in different representations.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8819
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8820 Content-Version = "Content-Version" ":" quoted-string
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8821
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8822 Examples of the Content-Version field include:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8823
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8824 Content-Version: "2.1.2"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8825 Content-Version: "Fred 19950116-12:26:48"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8826 Content-Version: "2.5a4-omega7"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8827
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8828 19.6.2.3 Derived-From
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8829
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8830 The Derived-From entity-header field can be used to indicate the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8831 version tag of the resource from which the enclosed entity was
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8832 derived before modifications were made by the sender. This field is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8833 used to help manage the process of merging successive changes to a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8834 resource, particularly when such changes are being made in parallel
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8835 and from multiple sources.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8836
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8837 Derived-From = "Derived-From" ":" quoted-string
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8838
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8839 An example use of the field is:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8840
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8841 Derived-From: "2.1.1"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8842
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8843 The Derived-From field is required for PUT and PATCH requests if the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8844 entity being sent was previously retrieved from the same URI and a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8845 Content-Version header was included with the entity when it was last
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8846 retrieved.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8847
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8848
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8849
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8850 Fielding, et. al. Standards Track [Page 158]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8851
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8852 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8853
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8854
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8855 19.6.2.4 Link
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8856
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8857 The Link entity-header field provides a means for describing a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8858 relationship between two resources, generally between the requested
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8859 resource and some other resource. An entity MAY include multiple Link
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8860 values. Links at the metainformation level typically indicate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8861 relationships like hierarchical structure and navigation paths. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8862 Link field is semantically equivalent to the <LINK> element in
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8863 HTML.[5]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8864
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8865 Link = "Link" ":" #("<" URI ">" *( ";" link-param )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8866
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8867 link-param = ( ( "rel" "=" relationship )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8868 | ( "rev" "=" relationship )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8869 | ( "title" "=" quoted-string )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8870 | ( "anchor" "=" <"> URI <"> )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8871 | ( link-extension ) )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8872
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8873 link-extension = token [ "=" ( token | quoted-string ) ]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8874
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8875 relationship = sgml-name
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8876 | ( <"> sgml-name *( SP sgml-name) <"> )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8877
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8878 sgml-name = ALPHA *( ALPHA | DIGIT | "." | "-" )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8879
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8880 Relationship values are case-insensitive and MAY be extended within
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8881 the constraints of the sgml-name syntax. The title parameter MAY be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8882 used to label the destination of a link such that it can be used as
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8883 identification within a human-readable menu. The anchor parameter MAY
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8884 be used to indicate a source anchor other than the entire current
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8885 resource, such as a fragment of this resource or a third resource.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8886
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8887 Examples of usage include:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8888
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8889 Link: <http://www.cern.ch/TheBook/chapter2>; rel="Previous"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8890
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8891 Link: <mailto:timbl@w3.org>; rev="Made"; title="Tim Berners-Lee"
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8892
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8893 The first example indicates that chapter2 is previous to this
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8894 resource in a logical navigation path. The second indicates that the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8895 person responsible for making the resource available is identified by
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8896 the given e-mail address.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8897
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8898 19.6.2.5 URI
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8899
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8900 The URI header field has, in past versions of this specification,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8901 been used as a combination of the existing Location, Content-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8902 Location, and Vary header fields as well as the future Alternates
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8903
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8904
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8905
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8906 Fielding, et. al. Standards Track [Page 159]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8907
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8908 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8909
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8910
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8911 field (above). Its primary purpose has been to include a list of
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8912 additional URIs for the resource, including names and mirror
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8913 locations. However, it has become clear that the combination of many
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8914 different functions within this single field has been a barrier to
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8915 consistently and correctly implementing any of those functions.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8916 Furthermore, we believe that the identification of names and mirror
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8917 locations would be better performed via the Link header field. The
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8918 URI header field is therefore deprecated in favor of those other
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8919 fields.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8920
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8921 URI-header = "URI" ":" 1#( "<" URI ">" )
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8922
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8923 19.7 Compatibility with Previous Versions
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8924
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8925 It is beyond the scope of a protocol specification to mandate
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8926 compliance with previous versions. HTTP/1.1 was deliberately
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8927 designed, however, to make supporting previous versions easy. It is
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8928 worth noting that at the time of composing this specification, we
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8929 would expect commercial HTTP/1.1 servers to:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8930
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8931 o recognize the format of the Request-Line for HTTP/0.9, 1.0, and 1.1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8932 requests;
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8933
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8934 o understand any valid request in the format of HTTP/0.9, 1.0, or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8935 1.1;
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8936
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8937 o respond appropriately with a message in the same major version used
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8938 by the client.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8939
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8940 And we would expect HTTP/1.1 clients to:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8941
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8942 o recognize the format of the Status-Line for HTTP/1.0 and 1.1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8943 responses;
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8944
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8945 o understand any valid response in the format of HTTP/0.9, 1.0, or
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8946 1.1.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8947
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8948 For most implementations of HTTP/1.0, each connection is established
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8949 by the client prior to the request and closed by the server after
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8950 sending the response. A few implementations implement the Keep-Alive
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8951 version of persistent connections described in section 19.7.1.1.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8952
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8953
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8954
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8955
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8956
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8957
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8958
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8959
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8960
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8961
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8962 Fielding, et. al. Standards Track [Page 160]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8963
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8964 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8965
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8966
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8967 19.7.1 Compatibility with HTTP/1.0 Persistent Connections
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8968
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8969 Some clients and servers may wish to be compatible with some previous
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8970 implementations of persistent connections in HTTP/1.0 clients and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8971 servers. Persistent connections in HTTP/1.0 must be explicitly
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8972 negotiated as they are not the default behavior. HTTP/1.0
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8973 experimental implementations of persistent connections are faulty,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8974 and the new facilities in HTTP/1.1 are designed to rectify these
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8975 problems. The problem was that some existing 1.0 clients may be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8976 sending Keep-Alive to a proxy server that doesn't understand
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8977 Connection, which would then erroneously forward it to the next
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8978 inbound server, which would establish the Keep-Alive connection and
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8979 result in a hung HTTP/1.0 proxy waiting for the close on the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8980 response. The result is that HTTP/1.0 clients must be prevented from
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8981 using Keep-Alive when talking to proxies.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8982
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8983 However, talking to proxies is the most important use of persistent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8984 connections, so that prohibition is clearly unacceptable. Therefore,
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8985 we need some other mechanism for indicating a persistent connection
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8986 is desired, which is safe to use even when talking to an old proxy
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8987 that ignores Connection. Persistent connections are the default for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8988 HTTP/1.1 messages; we introduce a new keyword (Connection: close) for
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8989 declaring non-persistence.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8990
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8991 The following describes the original HTTP/1.0 form of persistent
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8992 connections.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8993
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8994 When it connects to an origin server, an HTTP client MAY send the
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8995 Keep-Alive connection-token in addition to the Persist connection-
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8996 token:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8998 Connection: Keep-Alive
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8999
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9000 An HTTP/1.0 server would then respond with the Keep-Alive connection
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9001 token and the client may proceed with an HTTP/1.0 (or Keep-Alive)
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9002 persistent connection.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9003
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9004 An HTTP/1.1 server may also establish persistent connections with
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9005 HTTP/1.0 clients upon receipt of a Keep-Alive connection token.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9006 However, a persistent connection with an HTTP/1.0 client cannot make
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9007 use of the chunked transfer-coding, and therefore MUST use a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9008 Content-Length for marking the ending boundary of each message.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9009
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9010 A client MUST NOT send the Keep-Alive connection token to a proxy
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9011 server as HTTP/1.0 proxy servers do not obey the rules of HTTP/1.1
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9012 for parsing the Connection header field.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9013
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9014
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9015
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9016
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9017
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9018 Fielding, et. al. Standards Track [Page 161]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9019
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9020 RFC 2068 HTTP/1.1 January 1997
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9021
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9022
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9023 19.7.1.1 The Keep-Alive Header
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9024
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9025 When the Keep-Alive connection-token has been transmitted with a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9026 request or a response, a Keep-Alive header field MAY also be
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9027 included. The Keep-Alive header field takes the following form:
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9028
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9029 Keep-Alive-header = "Keep-Alive" ":" 0# keepalive-param
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9030
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9031 keepalive-param = param-name "=" value
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9032
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9033 The Keep-Alive header itself is optional, and is used only if a
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9034 parameter is being sent. HTTP/1.1 does not define any parameters.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9035
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9036 If the Keep-Alive header is sent, the corresponding connection token
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9037 MUST be transmitted. The Keep-Alive header MUST be ignored if
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9038 received without the connection token.
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9039
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9040
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9041
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9042
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9043
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9044
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9045
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9046
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9047
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9048
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9049
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9050
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9051
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9052
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9053
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9054
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9055
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9056
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9057
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9058
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9059
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9060
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9061
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9062
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9063
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9064
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9065
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9066
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9067
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9068
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9069
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9070
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9071
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9072
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9073
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9074 Fielding, et. al. Standards Track [Page 162]
e60a6ec4aa85 2004-7-12 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9075