| Network Working Group | R. Fielding |
| Internet Draft | Day Software |
| <draft-lafon-rfc2616bis-latest> | J. Gettys |
| Obsoletes: 2616 (if approved) | One Laptop per Child |
| Intended status: Standards Track | J. Mogul |
| Expires: June 2008 | HP |
| H. Frystyk | |
| Microsoft | |
| L. Masinter | |
| Adobe Systems | |
| P. Leach | |
| Microsoft | |
| T. Berners-Lee | |
| W3C/MIT | |
| Y. Lafon, Editor | |
| W3C | |
| J. F. Reschke, Editor | |
| greenbytes | |
| December 2007 |
Hypertext Transfer Protocol -- HTTP/1.1
draft-lafon-rfc2616bis-latest
By submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she is aware have been or will be disclosed, and any of which he or she becomes aware will be disclosed, in accordance with Section 6 of BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as “work in progress”.
The list of current Internet-Drafts can be accessed at <http://www.ietf.org/ietf/1id-abstracts.txt>.
The list of Internet-Draft Shadow Directories can be accessed at <http://www.ietf.org/shadow.html>.
This Internet-Draft will expire in June 2008.
Copyright © The IETF Trust (2007). All Rights Reserved.
The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. It is a generic, stateless, protocol which can be used for many tasks beyond its use for hypertext, such as name servers and distributed object management systems, through extension of its request methods, error codes and headers [RFC2324]. A feature of HTTP is the typing and negotiation of data representation, allowing systems to be built independently of the data being transferred.
HTTP has been in use by the World-Wide Web global information initiative since 1990. This specification defines the protocol referred to as "HTTP/1.1", and is an update to RFC2616.
Distribution of this document is unlimited. Please send comments to the Hypertext Transfer Protocol (HTTP) mailing list at ietf-http-wg@w3.org, which may be joined by sending a message with subject "subscribe" to ietf-http-wg-request@w3.org. Discussions of the HTTP working group are archived at <http://lists.w3.org/Archives/Public/ietf-http-wg/>. XML versions, latest edits and the issues list for this document are available from <http://www.w3.org/Protocols/HTTP/1.1/rfc2616bis/>.
The purpose of this document is to revise [RFC2616], doing only minimal corrections. For now, it is not planned to advance the standards level of HTTP, thus - if published - the specification will still be a "Proposed Standard" (see [RFC2026]).
The current plan is to incorporate known errata, and to update the specification text according to the current IETF publication guidelines. In particular:
This document is based on a variant of the original RFC2616 specification formatted using Marshall T. Rose's "xml2rfc" tool (see <http://xml.resource.org>) and therefore deviates from the original text in word wrapping, page breaks, list formatting, reference formatting, whitespace usage and appendix numbering. Otherwise, it is supposed to contain an accurate copy of the original specification text. See <http://www.w3.org/Protocols/HTTP/1.1/rfc2616bis-00-from-rfc2616.diff.html> for a comparison between both documents, as generated by "rfcdiff" (<http://tools.ietf.org/tools/rfcdiff/>).
| I rfc2616bis (type: edit, status: open) | ||
| julian.reschke@greenbytes.de | 2006-10-10 | Umbrella issue for changes with respect to the revision process itself. |
| Associated changes in this document: <#rfc.change.rfc2616bis.1>. | ||
| I i35-split-normative-and-informative-references (type: change, status: open) | ||
| References are now required to be split into "Normative" and "Informative". | ||
| julian.reschke@gmx.de | 2007-10-12 | See related issues: i65-informative-references, i68-encoding-references-normative, i75-rfc2145-normative, rfc1737_informative_and_obsolete, rfc1766_normative, i86-normative-up-to-date-references, rfc2048_informative_and_obsolete, rfc2396_normative, rfc2616bis, rfc2822_normative, unneeded_references, uri_vs_request_uri and usascii_normative. |
| I i40-header-registration (type: change, status: open) | ||
| A revision of RFC2616 should mention BCP 90 (Registration Procedures for Message Header Fields) and should take over as the authoritative reference for the headers it contains. | ||
| I need_iana_considerations (type: change, status: open) | ||
| julian.reschke@greenbytes.de | 2006-10-24 | We need an IANA Considerations section. Include update to HTTP header registration there? (Also: do we need a method name registry?) |
| I edit (type: edit, status: open) | ||
| julian.reschke@greenbytes.de | 2006-10-08 | Umbrella issue for editorial fixes/enhancements. |
| Associated changes in this document: 3.1, 3.1, 13.1, G. | ||
| I abnf-dquote (type: edit, status: closed) | ||
| julian.reschke@greenbytes.de | 2007-11-20 | Use DQUOTE instead of <"> in BNF. |
| 2007-11-20 | Resolution: Done. | |
| Associated changes in this document: 2.2, 2.2, 2.2, 2.2, 2.2, del-, 2.2, 14.9, 14.9, 14.9, 14.9, 14.9, 14.9, 14.46, 14.46. | ||
| I abnf-avoid-prose (type: change, status: open) | ||
| julian.reschke@greenbytes.de | 2007-11-23 | Avoid prose when an exact rule can be specified. |
| Associated changes in this document: 2.2, 2.2, 2.2, 2.2, 2.2, 2.2, 6.1.1. | ||
| I abnf-rule-names (type: edit, status: closed) | ||
| julian.reschke@greenbytes.de | 2007-11-22 | Fix invalid rule names: "http_URL" and "abs_path". |
| 2007-11-22 | Resolution: Replace "http_URL" by "http-URL" and "abs-path" by "path-absolute" (which is the name used in RFC3986). Also add BNF rules for the other rules imported from RFC2396. | |
| Associated changes in this document: 3.2.1, 3.2.1, 3.2.2, 3.2.2, 3.2.2, 3.2.2, 3.2.2, 3.2.3, 3.2.3, 5.1.2, 5.1.2, 5.1.2, 5.1.2. | ||
| I abnf-prose-cr (type: edit, status: closed) | ||
| julian.reschke@greenbytes.de | 2007-11-20 | Change BNF prose values to not contain line breaks. |
| 2007-11-20 | Resolution: Done. | |
| Associated changes in this document: 2.2, 2.2, 4.2. | ||
| I abnf-case-insensitive (type: edit, status: closed) | ||
| julian.reschke@greenbytes.de | 2007-11-20 | Rule names are case-insensitive. Fix name collisions. |
| julian.reschke@greenbytes.de | 2007-11-22 | Proposal: replace "host" by "uri-host", "trailer" by "trailer-part". |
| 2007-11-22 | Resolution: Done. | |
| Associated changes in this document: 3.2.2, 3.6.1, 3.6.1, 3.6.1, 14.23, 14.45, 14.46. | ||
| I abnf (type: change, status: open) | ||
| julian.reschke@greenbytes.de | 2006-12-03 | Update BNF to RFC4234 (plan to be added). |
| julian.reschke@greenbytes.de | 2007-07-24 | See <http://www.w3.org/mid/45FBAB8C.6010809@gmx.de> for a to-do list. |
| julian.reschke@greenbytes.de | 2007-11-13 | See <http://www.w3.org/mid/4739C417.2040203@gmx.de> for a summary of issues with the current ABNF. |
| I rfc2822_normative (type: change, status: open) | ||
| julian.reschke@greenbytes.de | 2006-12-03 | RFC822 ("STANDARD FOR THE FORMAT OF ARPA INTERNET TEXT MESSAGES") has been obsoleted by RFC2822 ("Internet Message Format"). Some of the references from RFC822 can be upgraded, some others are historical notes and should stay as they are. Also, RFC822 is the base for RFC2616's ABNF; as long as it has not been upgraded to RFC4234 format, we need to keep RFC822 as normative reference. See issue abnf. |
| julian.reschke@greenbytes.de | 2007-06-16 | RFC4897 requires us to add a note to the references explaining why the downref was made (see <http://tools.ietf.org/html/rfc4897#section-3.1>). |
| I rfc1737_informative_and_obsolete (type: change, status: open) | ||
| julian.reschke@greenbytes.de | 2006-10-27 | Classify RFC1737 ("Functional Requirements for Uniform Resource Names") as informative and update to RFC2141 ("URN Syntax") which seems to be a better reference. |
| Associated changes in this document: del-, 17.3. | ||
| I rfc2048_informative_and_obsolete (type: edit, status: open) | ||
| julian.reschke@greenbytes.de | 2006-11-15 | Classify RFC2048 ("Multipurpose Internet Mail Extensions (MIME) Part Four: Registration Procedures") as informative, update to RFC4288, potentially update the application/http and multipart/byteranges MIME type registration. Also, in Section 3.7 fix first reference to refer to RFC2046 (it's about media types in general, not the registration procedure). |
| julian.reschke@greenbytes.de | 2007-04-20 | Separate issue for updating the registration template: i55-updating-to-rfc4288. |
| Associated changes in this document: 3.7, 3.7, del-, 17.2, A. | ||
| I i34-updated-reference-for-uris (type: change, status: open) | ||
| julian.reschke@greenbytes.de | 2006-11-14 | Update RFC2396 ("Uniform Resource Identifiers (URI): Generic Syntax") to RFC3986. |
| I i50-misc-typos (type: edit, status: open) | ||
| a-travis@microsoft.com | 2006-12-18 | (See <http://lists.w3.org/Archives/Public/ietf-http-wg/2006OctDec/0275.html>). |
| julian.reschke@greenbytes.de | 2007-06-29 | Some of the strictly editorial issues have been resolves as part of issue "edit". |
The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. HTTP has been in use by the World-Wide Web global information initiative since 1990. The first version of HTTP, referred to as HTTP/0.9, was a simple protocol for raw data transfer across the Internet. HTTP/1.0, as defined by [RFC1945], improved the protocol by allowing messages to be in the format of MIME-like messages, containing metainformation about the data transferred and modifiers on the request/response semantics. However, HTTP/1.0 does not sufficiently take into consideration the effects of hierarchical proxies, caching, the need for persistent connections, or virtual hosts. In addition, the proliferation of incompletely-implemented applications calling themselves "HTTP/1.0" has necessitated a protocol version change in order for two communicating applications to determine each other's true capabilities.
This specification defines the protocol referred to as "HTTP/1.1". This protocol includes more stringent requirements than HTTP/1.0 in order to ensure reliable implementation of its features.
Practical information systems require more functionality than simple retrieval, including search, front-end update, and annotation. HTTP allows an open-ended set of methods and headers that indicate the purpose of a request [RFC2324]. It builds on the discipline of reference provided by the Uniform Resource Identifier (URI) [RFC1630], as a location (URL) [RFC1738] or name (URN) [RFC1737], for indicating the resource to which a method is to be applied. Messages are passed in a format similar to that used by Internet mail [RFC2822] as defined by the Multipurpose Internet Mail Extensions (MIME) [RFC2045].
HTTP is also used as a generic protocol for communication between user agents and proxies/gateways to other Internet systems, including those supported by the SMTP [RFC2821], NNTP [RFC3977], FTP [RFC959], Gopher [RFC1436], and WAIS [WAIS] protocols. In this way, HTTP allows basic hypermedia access to resources available from diverse applications.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].
An implementation is not compliant if it fails to satisfy one or more of the MUST or REQUIRED level requirements for the protocols it implements. An implementation that satisfies all the MUST or REQUIRED level and all the SHOULD level requirements for its protocols is said to be "unconditionally compliant"; one that satisfies all the MUST level requirements but not all the SHOULD level requirements for its protocols is said to be "conditionally compliant."
This specification uses a number of terms to refer to the roles played by participants in, and objects of, the HTTP communication.
| I i52-sort-1.3-terminology (type: edit, status: open) | ||
| a-travis@microsoft.com | 2006-12-21 | It's irritating to try and look up definitions in section 1.3. IMHO, the entries really should be sorted alphabetically, despite the fact that the terms have dependencies on one another. |
| julian.reschke@greenytes.de | 2006-06-15 | See action item <http://www.w3.org/2007/03/18-rfc2616-minutes.html#action23> and proposal in <http://lists.w3.org/Archives/Public/ietf-http-wg/2007AprJun/0350.html>. |
| julian.reschke@greenytes.de | 2006-06-15 |
I personally think we should not do this change:
(1) Sorting paragraphs makes it very hard to verify the changes; in essence, a reviewer would either need to trust us, or re-do the shuffling to control whether it's correct (nothing lost, no change in the definitions). (2) In the RFC2616 ordering, things that belong together (such as "client", "user agent", "server" ...) are close to each other. (3) Contrary to RFC2616, the text version of new spec will contain an alphabetical index section anyway (unless it's removed upon publication :-). |
connection
message
request
response
resource
entity
representation
content negotiation
variant
client
user agent
server
origin server
proxy
gateway
tunnel
cache
cacheable
first-hand
explicit expiration time
heuristic expiration time
age
freshness lifetime
fresh
stale
semantically transparent
validator
upstream/downstream
inbound/outbound
The HTTP protocol is a request/response protocol. A client sends a request to the server in the form of a request method, URI, and protocol version, followed by a MIME-like message containing request modifiers, client information, and possible body content over a connection with a server. The server responds with a status line, including the message's protocol version and a success or error code, followed by a MIME-like message containing server information, entity metainformation, and possible entity-body content. The relationship between HTTP and MIME is described in Appendix D.
Most HTTP communication is initiated by a user agent and consists of a request to be applied to a resource on some origin server. In the simplest case, this may be accomplished via a single connection (v) between the user agent (UA) and the origin server (O).
request chain ------------------------>
UA -------------------v------------------- O
<----------------------- response chain
A more complicated situation occurs when one or more intermediaries are present in the request/response chain. There are three common forms of intermediary: proxy, gateway, and tunnel. A proxy is a forwarding agent, receiving requests for a URI in its absolute form, rewriting all or part of the message, and forwarding the reformatted request toward the server identified by the URI. A gateway is a receiving agent, acting as a layer above some other server(s) and, if necessary, translating the requests to the underlying server's protocol. A tunnel acts as a relay point between two connections without changing the messages; tunnels are used when the communication needs to pass through an intermediary (such as a firewall) even when the intermediary cannot understand the contents of the messages.
request chain -------------------------------------->
UA -----v----- A -----v----- B -----v----- C -----v----- O
<------------------------------------- response chain
The figure above shows three intermediaries (A, B, and C) between the user agent and origin server. A request or response message that travels the whole chain will pass through four separate connections. This distinction is important because some HTTP communication options may apply only to the connection with the nearest, non-tunnel neighbor, only to the end-points of the chain, or to all connections along the chain. Although the diagram is linear, each participant may be engaged in multiple, simultaneous communications. For example, B may be receiving requests from many clients other than A, and/or forwarding requests to servers other than C, at the same time that it is handling A's request.
Any party to the communication which is not acting as a tunnel may employ an internal cache for handling requests. The effect of a cache is that the request/response chain is shortened if one of the participants along the chain has a cached response applicable to that request. The following illustrates the resulting chain if B has a cached copy of an earlier response from O (via C) for a request which has not been cached by UA or A.
request chain ---------->
UA -----v----- A -----v----- B - - - - - - C - - - - - - O
<--------- response chain
Not all responses are usefully cacheable, and some requests may contain modifiers which place special requirements on cache behavior. HTTP requirements for cache behavior and cacheable responses are defined in Section 13.
In fact, there are a wide variety of architectures and configurations of caches and proxies currently being experimented with or deployed across the World Wide Web. These systems include national hierarchies of proxy caches to save transoceanic bandwidth, systems that broadcast or multicast cache entries, organizations that distribute subsets of cached data via CD-ROM, and so on. HTTP systems are used in corporate intranets over high-bandwidth links, and for access via PDAs with low-power radio links and intermittent connectivity. The goal of HTTP/1.1 is to support the wide diversity of configurations already deployed while introducing protocol constructs that meet the needs of those who build web applications that require high reliability and, failing that, at least reliable indications of failure.
HTTP communication usually takes place over TCP/IP connections. The default port is TCP 80 (<http://www.iana.org/assignments/port-numbers>), but other ports can be used. This does not preclude HTTP from being implemented on top of any other protocol on the Internet, or on other networks. HTTP only presumes a reliable transport; any protocol that provides such guarantees can be used; the mapping of the HTTP/1.1 request and response structures onto the transport data units of the protocol in question is outside the scope of this specification.
In HTTP/1.0, most implementations used a new connection for each request/response exchange. In HTTP/1.1, a connection may be used for one or more request/response exchanges, although connections may be closed for a variety of reasons (see Section 8.1).
All of the mechanisms specified in this document are described in both prose and an augmented Backus-Naur Form (BNF) similar to that used by [RFC822ABNF]. Implementors will need to be familiar with the notation in order to understand this specification. The augmented BNF includes the following constructs:
name = definition
"literal"
rule1 | rule2
(rule1 rule2)
*rule
[rule]
N rule
#rule
( *LWS element *( *LWS "," *LWS element ))
1#element
; comment
implied *LWS
The following rules are used throughout this specification to describe basic parsing constructs. The US-ASCII coded character set is defined by ANSI X3.4-1986 [USASCII].
I ↓ OCTET = <any 8-bit sequence of data> CHAR = <any US-ASCII character (octets 0 - 127)> UPALPHA = <any US-ASCII uppercase letter "A".."Z"> LOALPHA = <any US-ASCII lowercase letter "a".."z"> ALPHA = UPALPHA | LOALPHA DIGIT = <any US-ASCII digit "0".."9"> CTL = I ↓<any US-ASCII control character (octets 0 - 31) and DEL (127)>%x00-1F | %x7F ; (octets 0 - 31) and DEL (127) CR = <US-ASCII CR, carriage return (13)> LF = <US-ASCII LF, linefeed (10)> SP = <US-ASCII SP, space (32)> HT = <US-ASCII HT, horizontal-tab (9)> ↑ I ↓<">DQUOTE = <US-ASCII double-quote mark (34)>
HTTP/1.1 defines the sequence CR LF as the end-of-line marker for all protocol elements except the entity-body (see Appendix C for tolerant applications). The end-of-line marker within an entity-body is defined by its associated media type, as described in Section 3.7.
CRLF = CR LF
HTTP/1.1 header field values can be folded onto multiple lines if the continuation line begins with a space or horizontal tab. All linear white space, including folding, has the same semantics as SP. A recipient MAY replace any linear white space with a single SP before interpreting the field value or forwarding the message downstream.
LWS = [CRLF] 1*( SP | HT )
| I i63-header-length-limit-with-encoded-words (type: change, status: open) | ||
| derhoermi@gmx.net | 2007-05-14 | (See <http://lists.w3.org/Archives/Public/ietf-http-wg/2007AprJun/0050.html>). |
| I i74-character-encodings-for-headers (type: change, status: open) | ||
| duerst@it.aoyama.ac.jp | 2007-07-10 | RFC 2616 prescribes that headers containing non-ASCII have to use either iso-8859-1 or RFC 2047. This is unnecessarily complex and not necessarily followed. At the least, new extensions should be allowed to specify that UTF-8 is used. |
The TEXT rule is only used for descriptive field contents and values that are not intended to be interpreted by the message parser. Words of *TEXT MAY contain characters from character sets other than ISO-8859-1 [ISO-8859-1] only when encoded according to the rules of [RFC2047].
TEXT = ↑ I ↓<any OCTET except CTLs, but including LWS>%x20-7E | %x80-FF | LWS ; any OCTET except CTLs, but including LWS
A CRLF is allowed in the definition of TEXT only as part of a header field continuation. It is expected that the folding LWS will be replaced with a single SP before interpretation of the TEXT value.
Hexadecimal numeric characters are used in several protocol elements.
HEX = "A" | "B" | "C" | "D" | "E" | "F"
| "a" | "b" | "c" | "d" | "e" | "f" | DIGIT
↓ Many HTTP/1.1 header field values consist of words separated by LWS or special characters. These special characters MUST be in a quoted string to be used within a parameter value (as defined in Section 3.6).
↑ I ↓ ↑ I ↓token = 1*<any CHAR except CTLs or separators>separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | ↑ I ↓<">DQUOTE | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT↑ I ↓ tchar = "!" | "#" | "$" | "%" | "&" | "'" | "*" | "+" | "-" | "." | "^" | "_" | "`" | "|" | "~" | DIGIT | ALPHA ; any CHAR except CTLs or separators token = 1*tchar
Comments can be included in some HTTP header fields by surrounding the comment text with parentheses. Comments are only allowed in fields containing "comment" as part of their field value definition. In all other fields, parentheses are considered part of the field value.
comment = "(" *( ctext | quoted-pair | comment ) ")"
ctext = ↑ I ↓<any TEXT excluding "(" and ")">%x20-27 | %x2A-7E | %x80-FF | LWS
; any TEXT excluding "(" and ")"
A string of text is parsed as a single word if it is quoted using double-quote marks.
quoted-string = ( ↑ I ↓<">DQUOTE *(qdtext | quoted-pair ) ↑ I ↓<">DQUOTE ) qdtext = ↑ I ↓<any TEXT excluding ↑ I ↓%x20-21 | %x23-5B | %x5D-7E | %x80-FF | LWS ; any TEXT excluding ↑ I ↓<">DQUOTE and "\"><">DQUOTE and "\"