< draft-ietf-http-v10-spec-03.txt   draft-ietf-http-v10-spec-04.txt >
HTTP Working Group T. Berners-Lee, MIT/LCS HTTP Working Group T. Berners-Lee, MIT/LCS
INTERNET-DRAFT R. Fielding, UC Irvine INTERNET-DRAFT R. Fielding, UC Irvine
<draft-ietf-http-v10-spec-03.txt> H. Frystyk, MIT/LCS <draft-ietf-http-v10-spec-04.txt> H. Frystyk, MIT/LCS
Expires March 4, 1996 September 4, 1995 Expires April 14, 1996 October 14, 1995
Hypertext Transfer Protocol -- HTTP/1.0 Hypertext Transfer Protocol -- HTTP/1.0
Status of this Memo Status of this Memo
This document is an Internet-Draft. Internet-Drafts are working This document is an Internet-Draft. Internet-Drafts are working
documents of the Internet Engineering Task Force (IETF), its areas, documents of the Internet Engineering Task Force (IETF), its areas,
and its working groups. Note that other groups may also distribute and its working groups. Note that other groups may also distribute
working documents as Internet-Drafts. working documents as Internet-Drafts.
skipping to change at line 42 skipping to change at line 42
the <www-talk@w3.org> mailing list. the <www-talk@w3.org> mailing list.
Abstract Abstract
The Hypertext Transfer Protocol (HTTP) is an application-level The Hypertext Transfer Protocol (HTTP) is an application-level
protocol with the lightness and speed necessary for distributed, protocol with the lightness and speed necessary for distributed,
collaborative, hypermedia information systems. It is a generic, collaborative, hypermedia information systems. It is a generic,
stateless, object-oriented protocol which can be used for many stateless, object-oriented protocol which can be used for many
tasks, such as name servers and distributed object management tasks, such as name servers and distributed object management
systems, through extension of its request methods (commands). A systems, through extension of its request methods (commands). A
feature of HTTP is the typing and negotiation of data feature of HTTP is the typing of data representation, allowing
representation, allowing systems to be built independently of the systems to be built independently of the data being transferred.
data being transferred.
HTTP has been in use by the World-Wide Web global information HTTP has been in use by the World-Wide Web global information
initiative since 1990. This specification reflects common usage of initiative since 1990. This specification reflects common usage of
the protocol referred to as "HTTP/1.0". the protocol referred to as "HTTP/1.0".
Table of Contents Table of Contents
1. Introduction 1. Introduction
1.1 Purpose 1.1 Purpose
1.2 Overall Operation 1.2 Terminology
1.3 Terminology 1.3 Overall Operation
2. Notational Conventions and Generic Grammar 2. Notational Conventions and Generic Grammar
2.1 Augmented BNF 2.1 Augmented BNF
2.2 Basic Rules 2.2 Basic Rules
3. Protocol Parameters 3. Protocol Parameters
3.1 HTTP Version 3.1 HTTP Version
3.2 Uniform Resource Identifiers 3.2 Uniform Resource Identifiers
3.2.1 General Syntax 3.2.1 General Syntax
3.2.2 http URL 3.2.2 http URL
skipping to change at line 77 skipping to change at line 76
3.4 Character Sets 3.4 Character Sets
3.5 Content Codings 3.5 Content Codings
3.6 Media Types 3.6 Media Types
3.6.1 Canonicalization and Text Defaults 3.6.1 Canonicalization and Text Defaults
3.6.2 Multipart Types 3.6.2 Multipart Types
3.7 Product Tokens 3.7 Product Tokens
4. HTTP Message 4. HTTP Message
4.1 Message Types 4.1 Message Types
4.2 Message Headers 4.2 Message Headers
4.3 General Message Header Fields 4.3 General Header Fields
5. Request 5. Request
5.1 Request-Line 5.1 Request-Line
5.2 Method 5.1.1 Method
5.2.1 GET 5.1.2 Request-URI
5.2.2 HEAD 5.2 Request Header Fields
5.2.3 POST
5.3 Request-URI
5.4 Request Header Fields
6. Response 6. Response
6.1 Status-Line 6.1 Status-Line
6.2 Status Codes and Reason Phrases 6.1.1 Status Code and Reason Phrase
6.2.1 Informational 1xx 6.2 Response Header Fields
6.2.2 Successful 2xx
6.2.3 Redirection 3xx
6.2.4 Client Error 4xx
6.2.5 Server Errors 5xx
6.3 Response Header Fields
7. Entity 7. Entity
7.1 Entity Header Fields 7.1 Entity Header Fields
7.2 Entity Body 7.2 Entity Body
7.2.1 Type 7.2.1 Type
7.2.2 Length 7.2.2 Length
8. Header Field Definitions 8. Method Definitions
8.1 Allow 8.1 GET
8.2 Authorization 8.2 HEAD
8.3 Content-Encoding 8.3 POST
8.4 Content-Length
8.5 Content-Type
8.6 Date
8.7 Expires
8.8 From
8.9 If-Modified-Since
8.10 Last-Modified
8.11 Location
8.12 MIME-Version
8.13 Pragma
8.14 Referer
8.15 Server
8.16 User-Agent
8.17 WWW-Authenticate
9. Access Authentication 9. Status Code Definitions
9.1 Basic Authentication Scheme 9.1 Informational 1xx
9.2 Successful 2xx
9.3 Redirection 3xx
9.4 Client Error 4xx
9.5 Server Error 5xx
10. Security Considerations 10. Header Field Definitions
10.1 Authentication of Clients 10.1 Allow
10.2 Safe Methods 10.2 Authorization
10.3 Abuse of Server Log Information 10.3 Content-Encoding
10.4 Transfer of Sensitive Information 10.4 Content-Length
10.5 Content-Type
10.6 Date
10.7 Expires
10.8 From
10.9 If-Modified-Since
10.10 Last-Modified
10.11 Location
10.12 MIME-Version
10.13 Pragma
10.14 Referer
10.15 Server
10.16 User-Agent
10.17 WWW-Authenticate
11. Acknowledgments 11. Access Authentication
11.1 Basic Authentication Scheme
12. References 12. Security Considerations
12.1 Authentication of Clients
12.2 Safe Methods
12.3 Abuse of Server Log Information
12.4 Transfer of Sensitive Information
13. Authors' Addresses 13. Acknowledgments
14. References
15. Authors' Addresses
Appendix A. Internet Media Type message/http Appendix A. Internet Media Type message/http
Appendix B. Tolerant Applications Appendix B. Tolerant Applications
Appendix C. Relationship to MIME Appendix C. Relationship to MIME
C.1 Conversion to Canonical Form C.1 Conversion to Canonical Form
C.1.1 Representation of Line Breaks C.1.1 Representation of Line Breaks
C.1.2 Default Character Set C.1.2 Default Character Set
C.2 Conversion of Date Formats C.2 Conversion of Date Formats
skipping to change at line 166 skipping to change at line 169
collaborative, hypermedia information systems. HTTP has been in use collaborative, hypermedia information systems. HTTP has been in use
by the World-Wide Web global information initiative since 1990. by the World-Wide Web global information initiative since 1990.
This specification reflects common usage of the protocol referred This specification reflects common usage of the protocol referred
to as "HTTP/1.0". This specification is not intended to become an to as "HTTP/1.0". This specification is not intended to become an
Internet standard; rather, it defines those features of the HTTP Internet standard; rather, it defines those features of the HTTP
protocol that can reasonably be expected of any implementation protocol that can reasonably be expected of any implementation
which claims to be using HTTP/1.0. which claims to be using HTTP/1.0.
Practical information systems require more functionality than Practical information systems require more functionality than
simple retrieval, including search, front-end update, and simple retrieval, including search, front-end update, and
annotation. HTTP/1.0 allows an open-ended set of methods to be used annotation. HTTP allows an open-ended set of methods to be used to
to indicate the purpose of a request. It builds on the discipline indicate the purpose of a request. It builds on the discipline of
of reference provided by the Uniform Resource Identifier (URI) [2], reference provided by the Uniform Resource Identifier (URI) [2], as
as a location (URL) [4] or name (URN) [16], for indicating the a location (URL) [4] or name (URN) [16], for indicating the
resource on which a method is to be applied. Messages are passed in resource on which a method is to be applied. Messages are passed in
a format similar to that used by Internet Mail [7] and the a format similar to that used by Internet Mail [7] and the
Multipurpose Internet Mail Extensions (MIME) [5]. Multipurpose Internet Mail Extensions (MIME) [5].
HTTP/1.0 is also used for communication between user agents and HTTP is also used as a generic protocol for communication between
various gateways, allowing hypermedia access to existing Internet user agents and proxies/gateways to other Internet protocols, such
protocols like SMTP [12], NNTP [11], FTP [14], Gopher [1], and as SMTP [12], NNTP [11], FTP [14], Gopher [1], and WAIS [8],
WAIS [8]. HTTP/1.0 is designed to allow such gateways, via proxy allowing basic hypermedia access to resources available from
servers, without any loss of the data conveyed by those earlier diverse applications and simplifying the implementation of user
protocols. agents.
1.2 Overall Operation
The HTTP protocol is based on a request/response paradigm. A
requesting program (termed a client) establishes a connection with
a receiving program (termed a server) and 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. The server responds
with a status line, including its protocol version and a success or
error code, followed by a MIME-like message containing server
information, entity metainformation, and possible body content. It
should be noted that a given program may be capable of being both a
client and a server; our use of those terms refers only to the role
being performed by the program during a particular connection,
rather than to the program's purpose in general.
On the Internet, the communication generally takes place over a
TCP/IP connection. The default port is TCP 80 [15], but other ports
can be used. This does not preclude the HTTP/1.0 protocol 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, and the mapping
of the HTTP/1.0 request and response structures onto the transport
data units of the protocol in question is outside the scope of this
specification.
Current practice requires that the connection be established by the
client prior to each request and closed by the server after sending
the response. Both clients and servers must be capable of handling
cases where either party closes the connection prematurely, due to
user action, automated time-out, or program failure. In any case,
the closing of the connection by either or both parties always
terminates the current request, regardless of its status.
1.3 Terminology 1.2 Terminology
This specification uses a number of terms to refer to the roles This specification uses a number of terms to refer to the roles
played by participants in, and objects of, the HTTP communication. played by participants in, and objects of, the HTTP communication.
connection connection
A virtual circuit established between two parties for the A transport layer virtual circuit established between two
purpose of communication. application programs for the purpose of communication.
message message
A structured sequence of octets transmitted via the connection The basic unit of HTTP communication, consisting of a structured
as the basic component of communication. sequence of octets matching the syntax defined in Section 4 and
transmitted via the connection.
request request
An HTTP request message (as defined in Section 5). An HTTP request message (as defined in Section 5).
response response
An HTTP response message (as defined in Section 6). An HTTP response message (as defined in Section 6).
resource resource
A network data object or service which can be identified by a A network data object or service which can be identified by a
URI (Section 3.2). URI (Section 3.2).
entity entity
A particular representation or rendition of a resource that may A particular representation or rendition of a data resource, or
be enclosed within a request or response message. An entity reply from a service resource, that may be enclosed within a
consists of metainformation in the form of entity headers and request or response message. An entity consists of
content in the form of an entity body. metainformation in the form of entity headers and content in the
form of an entity body.
client client
A program that establishes connections for the purpose of An application program that establishes connections for the
sending requests. purpose of sending requests.
user agent user agent
The client program which is closest to the user and which The client which initiates a request. These are often browsers,
initiates requests at their behest. These are often browsers,
editors, spiders (web-traversing robots), or other end user editors, spiders (web-traversing robots), or other end user
tools. tools.
server server
A program that accepts connections in order to service requests An application program that accepts connections in order to
by sending back responses. service requests by sending back responses.
origin server origin server
The server on which a given resource resides or is to be created. The server on which a given resource resides or is to be created.
proxy proxy
An intermediary program which acts as both a server and a client An intermediary program which acts as both a server and a client
for the purpose of forwarding requests. Proxies are often used for the purpose of making requests on behalf of other clients.
to act as a portal through a network firewall. A proxy server Requests are serviced internally or by passing them, with
accepts requests from other clients and services them either possible translation, on to other servers. A proxy must
internally or by passing them, with possible translation, on to interpret and, if necessary, rewrite a request message before
other servers. A caching proxy is a proxy server with a local forwarding it. Proxies are often used as client-side portals
cache of server responses -- some requested resources can be through network firewalls and as helper applications for
serviced from the cache rather than from the origin server. Some handling requests via protocols not implemented by the user
proxy servers also act as origin servers. agent.
gateway gateway
A proxy which services HTTP requests by translation into A server which acts as an intermediary for some other server.
protocols other than HTTP. The reply sent from the remote server Unlike a proxy, a gateway receives requests as if it were the
to the gateway is likewise translated into HTTP before being origin server for the requested resource; the requesting client
forwarded to the user agent. may not be aware that it is communicating with a gateway.
Gateways are often used as server-side portals through network
firewalls and as protocol translators for access to resources
stored on non-HTTP systems.
tunnel
A tunnel is an intermediary program which is acting as a blind
relay between two connections. Once active, a tunnel is not
considered a party to the HTTP communication, though the tunnel
may have been initiated by an HTTP request. A tunnel is closed
when both ends of the relayed connections are closed. Tunnels
are used when a portal is necessary and the intermediary cannot,
or should not, interpret the relayed communication.
cache
A program's local store of response messages and the subsystem
that controls its message storage, retrieval, and deletion. A
cache stores cachable responses in order to reduce the response
time and network bandwidth consumption on future, equivalent
requests. Any client or server may include a cache, though a
cache cannot be used by a server while it is acting as a tunnel.
Any given program may be capable of being both a client and a
server; our use of these terms refers only to the role being
performed by the program for a particular connection, rather than
to the program's capabilities in general. Likewise, any server may
act as an origin server, proxy, gateway, or tunnel, switching
behavior based on the nature of each request.
1.3 Overall Operation
The HTTP protocol is based on a request/response paradigm. A client
establishes a connection with a server and 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. 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 body
content.
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 parts 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 must 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 cachable, and some requests may contain
modifiers which place special requirements on cache behavior.
Historically, HTTP/1.0 applications have not adequately defined
what is or is not a "cachable" response.
On the Internet, HTTP communication generally takes place over
TCP/IP connections. The default port is TCP 80 [15], 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, and the mapping
of the HTTP/1.0 request and response structures onto the transport
data units of the protocol in question is outside the scope of this
specification.
Current practice requires that the connection be established by the
client prior to each request and closed by the server after sending
the response. Both clients and servers must be capable of handling
cases where either party closes the connection prematurely, due to
user action, automated time-out, or program failure. In any case,
the closing of the connection by either or both parties always
terminates the current request, regardless of its status.
2. Notational Conventions and Generic Grammar 2. Notational Conventions and Generic Grammar
2.1 Augmented BNF 2.1 Augmented BNF
All of the mechanisms specified in this document are described in All of the mechanisms specified in this document are described in
both prose and an augmented Backus-Naur Form (BNF) similar to that both prose and an augmented Backus-Naur Form (BNF) similar to that
used by RFC 822 [7]. Implementors will need to be familiar with the used by RFC 822 [7]. Implementors will need to be familiar with the
notation in order to understand this specification. The augmented notation in order to understand this specification. The augmented
BNF includes the following constructs: BNF includes the following constructs:
skipping to change at line 375 skipping to change at line 460
; comment ; comment
A semi-colon, set off some distance to the right of rule text, A semi-colon, set off some distance to the right of rule text,
starts a comment that continues to the end of line. This is a starts a comment that continues to the end of line. This is a
simple way of including useful notes in parallel with the simple way of including useful notes in parallel with the
specifications. specifications.
implied *LWS implied *LWS
The grammar described by this specification is word-based. The grammar described by this specification is word-based.
Except where noted otherwise, zero or more linear whitespace Except where noted otherwise, linear whitespace (LWS) can be
(LWS) can be included between any two adjacent words (token or included between any two adjacent words (token or
quoted-string), and between adjacent tokens and delimiters quoted-string), and between adjacent tokens and delimiters
(tspecials), without changing the interpretation of a field. (tspecials), without changing the interpretation of a field.
However, applications should attempt to follow "common form" However, applications should attempt to follow "common form"
when generating HTTP constructs, since there exist some when generating HTTP constructs, since there exist some
implementations that fail to accept anything beyond the common implementations that fail to accept anything beyond the common
forms. forms.
2.2 Basic Rules 2.2 Basic Rules
The following rules are used throughout this specification to The following rules are used throughout this specification to
skipping to change at line 412 skipping to change at line 497
<"> = <US-ASCII double-quote mark (34)> <"> = <US-ASCII double-quote mark (34)>
HTTP/1.0 defines the octet sequence CR LF as the end-of-line marker HTTP/1.0 defines the octet sequence CR LF as the end-of-line marker
for all protocol elements except the Entity-Body (see Appendix B for all protocol elements except the Entity-Body (see Appendix B
for tolerant applications). The end-of-line marker within an for tolerant applications). The end-of-line marker within an
Entity-Body is defined by its associated media type, as described Entity-Body is defined by its associated media type, as described
in Section 3.6. in Section 3.6.
CRLF = CR LF CRLF = CR LF
HTTP/1.0 headers may be folded onto multiple lines if the HTTP/1.0 headers may be folded onto multiple lines if each
continuation lines begin with linear whitespace characters. All continuation line begins with a space or horizontal tab. All linear
linear whitespace, including folding, has the same semantics as SP. whitespace, including folding, has the same semantics as SP.
LWS = [CRLF] 1*( SP | HT ) LWS = [CRLF] 1*( SP | HT )
However, folding of header lines is not expected by some However, folding of header lines is not expected by some
applications, and should not be generated by HTTP/1.0 applications. applications, and should not be generated by HTTP/1.0 applications.
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 octets from character sets other
than US-ASCII.
TEXT = <any OCTET except CTLs,
but including LWS>
Recipients of header field TEXT containing octets outside the
US-ASCII character set may assume that they represent ISO-8859-1
characters.
Many HTTP/1.0 header field values consist of words separated by LWS Many HTTP/1.0 header field values consist of words separated by LWS
or special characters. These special characters must be in a quoted or special characters. These special characters must be in a quoted
string to be used within a parameter value. string to be used within a parameter value.
word = token | quoted-string word = token | quoted-string
token = 1*<any CHAR except CTLs or tspecials> token = 1*<any CHAR except CTLs or tspecials>
tspecials = "(" | ")" | "<" | ">" | "@" tspecials = "(" | ")" | "<" | ">" | "@"
| "," | ";" | ":" | "\" | <"> | "," | ";" | ":" | "\" | <">
| "/" | "[" | "]" | "?" | "=" | "/" | "[" | "]" | "?" | "="
| "{" | "}" | SP | HT | "{" | "}" | SP | HT
Comments may be included in some HTTP header fields by surrounding Comments may be included in some HTTP header fields by surrounding
the comment text with parentheses. Comments are only allowed in the comment text with parentheses. Comments are only allowed in
fields containing "comment" as part of their field value definition. fields containing "comment" as part of their field value definition.
comment = "(" *( ctext | comment ) ")" comment = "(" *( ctext | comment ) ")"
ctext = <any text excluding "(" and ")"> ctext = <any TEXT excluding "(" and ")">
A string of text is parsed as a single word if it is quoted using A string of text is parsed as a single word if it is quoted using
double-quote marks. double-quote marks.
quoted-string = ( <"> *(qdtext) <"> ) quoted-string = ( <"> *(qdtext) <"> )
qdtext = <any CHAR except <"> and CTLs, qdtext = <any CHAR except <"> and CTLs,
but including LWS> but including LWS>
Single-character quoting using the backslash ("\") character is not Single-character quoting using the backslash ("\") character is not
permitted in HTTP/1.0. permitted in HTTP/1.0.
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 octets from character sets other
than US-ASCII.
text = <any OCTET except CTLs,
but including LWS>
Recipients of header field text containing octets outside the
US-ASCII character set may assume that they represent ISO-8859-1
characters.
3. Protocol Parameters 3. Protocol Parameters
3.1 HTTP Version 3.1 HTTP Version
HTTP uses a "<major>.<minor>" numbering scheme to indicate versions HTTP uses a "<major>.<minor>" numbering scheme to indicate versions
of the protocol. The protocol versioning policy is intended to of the protocol. The protocol versioning policy is intended to
allow the sender to indicate the format of a message and its allow the sender to indicate the format of a message and its
capacity for understanding further HTTP communication, rather than capacity for understanding further HTTP communication, rather than
the features obtained via that communication. No change is made to the features obtained via that communication. No change is made to
the version number for the addition of message components which do the version number for the addition of message components which do
skipping to change at line 518 skipping to change at line 603
o respond appropriately with a message in the same protocol o respond appropriately with a message in the same protocol
version used by the client. version used by the client.
HTTP/1.0 clients must: HTTP/1.0 clients must:
o recognize the format of the Status-Line for HTTP/1.0 responses; o recognize the format of the Status-Line for HTTP/1.0 responses;
o understand any valid response in the format of HTTP/0.9 or o understand any valid response in the format of HTTP/0.9 or
HTTP/1.0. HTTP/1.0.
Proxies must be careful in forwarding requests that are received in Proxy and gateway applications must be careful in forwarding
a format different than that of the proxy's native version. Since requests that are received in a format different than that of the
the protocol version indicates the protocol capability of the application's native HTTP version. Since the protocol version
sender, a proxy must never send a message with a version indicator indicates the protocol capability of the sender, a proxy/gateway
which is greater than its native version; if a higher version must never send a message with a version indicator which is greater
request is received, the proxy must either downgrade the request than its native version; if a higher version request is received,
version or respond with an error. Requests with a version lower the proxy/gateway must either downgrade the request version or
than that of the proxy's native format may be upgraded by the proxy respond with an error. Requests with a version lower than that of
before being forwarded; the proxy's response to that request must the application's native format may be upgraded before being
follow the normal server requirements. forwarded; the proxy/gateway's response to that request must follow
the normal server requirements.
3.2 Uniform Resource Identifiers 3.2 Uniform Resource Identifiers
URIs have been known by many names: WWW addresses, Universal URIs have been known by many names: WWW addresses, Universal
Document Identifiers, Universal Resource Identifiers [2], and Document Identifiers, Universal Resource Identifiers [2], and
finally the combination of Uniform Resource Locators (URL) [4] and finally the combination of Uniform Resource Locators (URL) [4] and
Names (URN) [16]. As far as HTTP is concerned, Uniform Resource Names (URN) [16]. As far as HTTP is concerned, Uniform Resource
Identifiers are simply formatted strings which identify--via name, Identifiers are simply formatted strings which identify--via name,
location, or any other characteristic--a network resource. location, or any other characteristic--a network resource.
skipping to change at line 581 skipping to change at line 667
escape = "%" hex hex escape = "%" hex hex
hex = "A" | "B" | "C" | "D" | "E" | "F" hex = "A" | "B" | "C" | "D" | "E" | "F"
| "a" | "b" | "c" | "d" | "e" | "f" | DIGIT | "a" | "b" | "c" | "d" | "e" | "f" | DIGIT
reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" reserved = ";" | "/" | "?" | ":" | "@" | "&" | "="
safe = "$" | "-" | "_" | "." | "+" safe = "$" | "-" | "_" | "." | "+"
extra = "!" | "*" | "'" | "(" | ")" | "," extra = "!" | "*" | "'" | "(" | ")" | ","
national = <any OCTET excluding CTLs, SP, national = <any OCTET excluding CTLs, SP,
ALPHA, DIGIT, reserved, safe, and extra> ALPHA, DIGIT, reserved, safe, and extra>
For definitive information on URL syntax and semantics, see For definitive information on URL syntax and semantics, see RFC
RFC 1738 [4] and RFC 1808 [9]. The BNF above includes national 1738 [4] and RFC 1808 [9]. The BNF above includes national
characters not allowed in valid URLs as specified by RFC 1738, characters not allowed in valid URLs as specified by RFC 1738,
since HTTP servers are not restricted in the set of unreserved since HTTP servers are not restricted in the set of unreserved
characters allowed to represent the rel_path part of addresses, and characters allowed to represent the rel_path part of addresses, and
HTTP proxies may receive requests for URIs not defined by RFC 1738. HTTP proxies may receive requests for URIs not defined by RFC 1738.
3.2.2 http URL 3.2.2 http URL
The "http" scheme is used to locate network resources via the HTTP The "http" scheme is used to locate network resources via the HTTP
protocol. This section defines the scheme-specific syntax and protocol. This section defines the scheme-specific syntax and
semantics for http URLs. semantics for http URLs.
http_URL = "http:" "//" host [ ":" port ] abs_path http_URL = "http:" "//" host [ ":" port ] abs_path
host = <FQDN or IP address, as defined in RFC 1738> host = <A legal Internet host domain name
or IP address (in dotted-decimal form),
as defined by Section 2.1 of RFC 1123>
port = *DIGIT port = *DIGIT
If the port is empty or not given, port 80 is assumed. The If the port is empty or not given, port 80 is assumed. The
semantics are that the identified resource is located at the server semantics are that the identified resource is located at the server
listening for TCP connections on that port of that host, and the listening for TCP connections on that port of that host, and the
Request-URI for the resource is abs_path. If the abs_path is not Request-URI for the resource is abs_path. If the abs_path is not
present in the URL, it must be given as "/" when used as a present in the URL, it must be given as "/" when used as a
Request-URI. Request-URI.
Note: Although the HTTP protocol is independent of the
transport layer protocol, the http URL only identifies
resources by their TCP location, and thus non-TCP resources
must be identified by some other URI scheme.
The canonical form for "http" URLs is obtained by converting any The canonical form for "http" URLs is obtained by converting any
UPALPHA characters in host to their LOALPHA equivalent (hostnames UPALPHA characters in host to their LOALPHA equivalent (hostnames
are case-insensitive), eliding the [ ":" port ] if the port is 80, are case-insensitive), eliding the [ ":" port ] if the port is 80,
and replacing an empty abs_path with "/". and replacing an empty abs_path with "/".
3.3 Date/Time Formats 3.3 Date/Time Formats
HTTP/1.0 applications have historically allowed three different HTTP/1.0 applications have historically allowed three different
formats for the representation of date/time stamps: formats for the representation of date/time stamps:
skipping to change at line 631 skipping to change at line 725
represents a fixed-length subset of that defined by RFC 1123 [6] represents a fixed-length subset of that defined by RFC 1123 [6]
(an update to RFC 822 [7]). The second format is in common use, but (an update to RFC 822 [7]). The second format is in common use, but
is based on the obsolete RFC 850 [10] date format and lacks a is based on the obsolete RFC 850 [10] date format and lacks a
four-digit year. HTTP/1.0 clients and servers that parse the date four-digit year. HTTP/1.0 clients and servers that parse the date
value should accept all three formats, though they must never value should accept all three formats, though they must never
generate the third (asctime) format. generate the third (asctime) format.
Note: Recipients of date values are encouraged to be robust Note: Recipients of date values are encouraged to be robust
in accepting date values that may have been generated by in accepting date values that may have been generated by
non-HTTP applications, as is sometimes the case when non-HTTP applications, as is sometimes the case when
retrieving or posting messages via gateways to SMTP or NNTP. retrieving or posting messages via proxies/gateways to SMTP
or NNTP.
All HTTP/1.0 date/time stamps must be represented in Universal Time All HTTP/1.0 date/time stamps must be represented in Universal Time
(UT), also known as Greenwich Mean Time (GMT), without exception. (UT), also known as Greenwich Mean Time (GMT), without exception.
This is indicated in the first two formats by the inclusion of This is indicated in the first two formats by the inclusion of
"GMT" as the three-letter abbreviation for time zone, and should be "GMT" as the three-letter abbreviation for time zone, and should be
assumed when reading the asctime format. assumed when reading the asctime format.
HTTP-date = rfc1123-date | rfc850-date | asctime-date HTTP-date = rfc1123-date | rfc850-date | asctime-date
rfc1123-date = wkday "," SP date1 SP time SP "GMT" rfc1123-date = wkday "," SP date1 SP time SP "GMT"
skipping to change at line 713 skipping to change at line 808
| "ISO-8859-1" | "ISO-8859-2" | "ISO-8859-3" | "ISO-8859-1" | "ISO-8859-2" | "ISO-8859-3"
| "ISO-8859-4" | "ISO-8859-5" | "ISO-8859-6" | "ISO-8859-4" | "ISO-8859-5" | "ISO-8859-6"
| "ISO-8859-7" | "ISO-8859-8" | "ISO-8859-9" | "ISO-8859-7" | "ISO-8859-8" | "ISO-8859-9"
| "ISO-2022-JP" | "ISO-2022-JP-2" | "ISO-2022-KR" | "ISO-2022-JP" | "ISO-2022-JP-2" | "ISO-2022-KR"
| "UNICODE-1-1" | "UNICODE-1-1-UTF-7" | "UNICODE-1-1-UTF-8" | "UNICODE-1-1" | "UNICODE-1-1-UTF-7" | "UNICODE-1-1-UTF-8"
| token | token
Although HTTP allows an arbitrary token to be used as a charset Although HTTP allows an arbitrary token to be used as a charset
value, any token that has a predefined value within the IANA value, any token that has a predefined value within the IANA
Character Set registry [15] must represent the character set Character Set registry [15] must represent the character set
defined by that registry. Applications are encouraged, but not defined by that registry. Applications should limit their use of
required, to limit their use of character sets to those defined by character sets to those defined by the IANA registry.
the IANA registry.
Note: This use of the term "character set" is more commonly Note: This use of the term "character set" is more commonly
referred to as a "character encoding." However, since HTTP referred to as a "character encoding." However, since HTTP
and MIME share the same registry, it is important that the and MIME share the same registry, it is important that the
terminology also be shared. terminology also be shared.
3.5 Content Codings 3.5 Content Codings
Content coding values are used to indicate an encoding Content coding values are used to indicate an encoding
transformation that has been or can be applied to a resource. transformation that has been applied to a resource. Content codings
Content codings are primarily used to allow a document to be are primarily used to allow a document to be compressed or
compressed or encrypted without losing the identity of its encrypted without losing the identity of its underlying media type.
underlying media type. Typically, the resource is stored in this Typically, the resource is stored in this encoding and only decoded
encoding and only decoded before rendering or analogous usage. before rendering or analogous usage.
content-coding = "x-gzip" | "x-compress" | token content-coding = "x-gzip" | "x-compress" | token
Note: For future compatibility, HTTP/1.0 applications should Note: For future compatibility, HTTP/1.0 applications should
consider "gzip" and "compress" to be equivalent to "x-gzip" consider "gzip" and "compress" to be equivalent to "x-gzip"
and "x-compress", respectively. and "x-compress", respectively.
All content-coding values are case-insensitive. HTTP/1.0 uses All content-coding values are case-insensitive. HTTP/1.0 uses
content-coding values in the Content-Encoding (Section 8.3) header content-coding values in the Content-Encoding (Section 10.3) header
field. Although the value describes the content-coding, what is field. Although the value describes the content-coding, what is
more important is that it indicates what decoding mechanism will be more important is that it indicates what decoding mechanism will be
required to remove the encoding. Note that a single program may be required to remove the encoding. Note that a single program may be
capable of decoding multiple content-coding formats. Two values are capable of decoding multiple content-coding formats. Two values are
defined by this specification: defined by this specification:
x-gzip x-gzip
An encoding format produced by the file compression program An encoding format produced by the file compression program
"gzip" (GNU zip) developed by Jean-loup Gailly. This format is "gzip" (GNU zip) developed by Jean-loup Gailly. This format is
typically a Lempel-Ziv coding (LZ77) with a 32 bit CRC. Gzip is typically a Lempel-Ziv coding (LZ77) with a 32 bit CRC. Gzip is
skipping to change at line 764 skipping to change at line 858
"compress". This format is an adaptive Lempel-Ziv-Welch coding "compress". This format is an adaptive Lempel-Ziv-Welch coding
(LZW). (LZW).
Note: Use of program names for the identification of Note: Use of program names for the identification of
encoding formats is not desirable and should be discouraged encoding formats is not desirable and should be discouraged
for future encodings. Their use here is representative of for future encodings. Their use here is representative of
historical practice, not good design. historical practice, not good design.
3.6 Media Types 3.6 Media Types
HTTP uses Internet Media Types [13] (formerly referred to as MIME HTTP uses Internet Media Types [13] in the Content-Type header
Content-Types [5]) in order to provide open and extensible data field (Section 10.5) in order to provide open and extensible data
typing and type negotiation. For mail applications, where there is typing. For mail applications, where there is no type negotiation
no type negotiation between sender and receiver, it is reasonable between sender and recipient, it is reasonable to put strict limits
to put strict limits on the set of allowed media types. With HTTP, on the set of allowed media types. With HTTP, where the sender and
where the sender and recipient can communicate directly, recipient can communicate directly, applications are allowed more
applications are allowed more freedom in the use of non-registered freedom in the use of non-registered types. The following grammar
types. The following grammar for media types is a superset of that for media types is a superset of that for MIME because it does not
for MIME because it does not restrict itself to the official IANA restrict itself to the official IANA and x-token types.
and x-token types.
media-type = type "/" subtype *( ";" parameter ) media-type = type "/" subtype *( ";" parameter )
type = token type = token
subtype = token subtype = token
Parameters may follow the type/subtype in the form of Parameters may follow the type/subtype in the form of
attribute/value pairs. attribute/value pairs.
parameter = attribute "=" value parameter = attribute "=" value
attribute = token attribute = token
skipping to change at line 806 skipping to change at line 899
they are necessary to define the content of a message. they are necessary to define the content of a message.
If a given media-type value has been registered by the IANA, any If a given media-type value has been registered by the IANA, any
use of that value must be indicative of the registered data format. use of that value must be indicative of the registered data format.
Although HTTP allows the use of non-registered media types, such Although HTTP allows the use of non-registered media types, such
usage must not conflict with the IANA registry. Data providers are usage must not conflict with the IANA registry. Data providers are
strongly encouraged to register their media types with IANA via the strongly encouraged to register their media types with IANA via the
procedures outlined in RFC 1590 [13]. procedures outlined in RFC 1590 [13].
All media-type's registered by IANA must be preferred over All media-type's registered by IANA must be preferred over
extension tokens. However, HTTP does not limit conforming extension tokens. However, HTTP does not limit applications to the
applications to the use of officially registered media types, nor use of officially registered media types, nor does it encourage the
does it encourage the use of an "x-" prefix for unofficial types use of an "x-" prefix for unofficial types outside of explicitly
outside of explicitly short experimental use between consenting short experimental use between consenting applications.
applications.
3.6.1 Canonicalization and Text Defaults 3.6.1 Canonicalization and Text Defaults
Media types are registered in a canonical form. In general, entity Media types are registered in a canonical form. In general, entity
bodies transferred via HTTP must be represented in the appropriate bodies transferred via HTTP must be represented in the appropriate
canonical form prior to transmission. If the body has been encoded canonical form prior to transmission. If the body has been encoded
via a Content-Encoding, the data must be in canonical form prior to via a Content-Encoding, the data must be in canonical form prior to
that encoding. However, HTTP modifies the canonical form that encoding. However, HTTP modifies the canonical form
requirements for media of primary type "text" and for "application" requirements for media of primary type "text" and for "application"
types consisting of text-like records. types consisting of text-like records.
skipping to change at line 913 skipping to change at line 1005
identifier (i.e., successive versions of the same product should identifier (i.e., successive versions of the same product should
only differ in the product-version portion of the product value). only differ in the product-version portion of the product value).
4. HTTP Message 4. HTTP Message
4.1 Message Types 4.1 Message Types
HTTP messages consist of requests from client to server and HTTP messages consist of requests from client to server and
responses from server to client. responses from server to client.
HTTP-message = Simple-Request ; HTTP/0.9 messages HTTP-message = Simple-Request ; HTTP/0.9 messages
| Simple-Response | Simple-Response
| Full-Request ; HTTP/1.0 messages | Full-Request ; HTTP/1.0 messages
| Full-Response | Full-Response
Full-Request and Full-Response use the generic message format of Full-Request and Full-Response use the generic message format of
RFC 822 [7] for transferring entities. Both messages may include RFC 822 [7] for transferring entities. Both messages may include
optional header fields (a.k.a. "headers") and an entity body. The optional header fields (also known as "headers") and an entity
entity body is separated from the headers by a null line (i.e., a body. The entity body is separated from the headers by a null line
line with nothing preceding the CRLF). (i.e., a line with nothing preceding the CRLF).
Full-Request = Request-Line ; Section 5.1 Full-Request = Request-Line ; Section 5.1
*( General-Header ; Section 4.3 *( General-Header ; Section 4.3
| Request-Header ; Section 5.4 | Request-Header ; Section 5.2
| Entity-Header ) ; Section 7.1 | Entity-Header ) ; Section 7.1
CRLF CRLF
[ Entity-Body ] ; Section 7.2 [ Entity-Body ] ; Section 7.2
Full-Response = Status-Line ; Section 6.1 Full-Response = Status-Line ; Section 6.1
*( General-Header ; Section 4.3 *( General-Header ; Section 4.3
| Response-Header ; Section 6.3 | Response-Header ; Section 6.2
| Entity-Header ) ; Section 7.1 | Entity-Header ) ; Section 7.1
CRLF CRLF
[ Entity-Body ] ; Section 7.2 [ Entity-Body ] ; Section 7.2
Simple-Request and Simple-Response do not allow the use of any Simple-Request and Simple-Response do not allow the use of any
header information and are limited to a single request method (GET). header information and are limited to a single request method (GET).
Simple-Request = "GET" SP Request-URI CRLF Simple-Request = "GET" SP Request-URI CRLF
Simple-Response = [ Entity-Body ] Simple-Response = [ Entity-Body ]
Use of the Simple-Request format is discouraged because it prevents Use of the Simple-Request format is discouraged because it prevents
the server from identifying the media type of the returned entity. the server from identifying the media type of the returned entity.
4.2 Message Headers 4.2 Message Headers
HTTP header fields, which include General-Header (Section 4.3), HTTP header fields, which include General-Header (Section 4.3),
Request-Header (Section 5.4), Response-Header (Section 6.3), and Request-Header (Section 5.2), Response-Header (Section 6.2), and
Entity-Header (Section 7.1) fields, follow the same generic format Entity-Header (Section 7.1) fields, follow the same generic format
as that given in Section 3.1 of RFC 822 [7]. Each header field as that given in Section 3.1 of RFC 822 [7]. Each header field
consists of a name followed immediately by a colon (":"), a single consists of a name followed immediately by a colon (":"), a single
space (SP) character, and the field value. Field names are space (SP) character, and the field value. Field names are
case-insensitive. Header fields can be extended over multiple lines case-insensitive. Header fields can be extended over multiple lines
by preceding each extra line with at least one LWS, though this is by preceding each extra line with at least one SP or HT, though
not recommended. this is not recommended.
HTTP-header = field-name ":" [ field-value ] CRLF HTTP-header = field-name ":" [ field-value ] CRLF
field-name = 1*<any CHAR, excluding CTLs, SP, and ":"> field-name = token
field-value = *( field-content | LWS ) field-value = *( field-content | LWS )
field-content = <the OCTETs making up the field-value field-content = <the OCTETs making up the field-value
and consisting of either *text or combinations and consisting of either *TEXT or combinations
of token, tspecials, and quoted-string> of token, tspecials, and quoted-string>
The order in which header fields are received is not significant. The order in which header fields are received is not significant.
However, it is "good practice" to send General-Header fields first, However, it is "good practice" to send General-Header fields first,
followed by Request-Header or Response-Header fields prior to the followed by Request-Header or Response-Header fields prior to the
Entity-Header fields. Entity-Header fields.
Multiple HTTP-header fields with the same field-name may be present Multiple HTTP-header fields with the same field-name may be present
in a message if and only if the entire field-value for that header in a message if and only if the entire field-value for that header
field is defined as a comma-separated list [i.e., #(values)]. It field is defined as a comma-separated list [i.e., #(values)]. It
must be possible to combine the multiple header fields into one must be possible to combine the multiple header fields into one
"field-name: field-value" pair, without changing the semantics of "field-name: field-value" pair, without changing the semantics of
the message, by appending each subsequent field-value to the first, the message, by appending each subsequent field-value to the first,
each separated by a comma. each separated by a comma.
4.3 General Message Header Fields 4.3 General Header Fields
There are a few header fields which have general applicability for There are a few header fields which have general applicability for
both request and response messages, but which do not apply to the both request and response messages, but which do not apply to the
communicating parties or the content being transferred. These entity being transferred. These headers apply only to the message
headers apply only to the message being transmitted. being transmitted.
General-Header = Date ; Section 8.6 General-Header = Date ; Section 10.6
| MIME-Version ; Section 8.12 | MIME-Version ; Section 10.12
| Pragma ; Section 8.13 | Pragma ; Section 10.13
General header field names can be extended only via a change in the General header field names can be extended reliably only in
protocol version. Unknown header fields are treated as combination with a change in the protocol version. However, new or
experimental header fields may be given the semantics of general
header fields if all parties in the communication recognize them to
be general header fields. Unknown header fields are treated as
Entity-Header fields. Entity-Header fields.
5. Request 5. Request
A request message from a client to a server includes, within the A request message from a client to a server includes, within the
first line of that message, the method to be applied to the first line of that message, the method to be applied to the
resource requested, the identifier of the resource, and the resource, the identifier of the resource, and the protocol version
protocol version in use. For backwards compatibility with the more in use. For backwards compatibility with the more limited HTTP/0.9
limited HTTP/0.9 protocol, there are two valid formats for an HTTP protocol, there are two valid formats for an HTTP request:
request:
Request = Simple-Request | Full-Request Request = Simple-Request | Full-Request
Simple-Request = "GET" SP Request-URI CRLF Simple-Request = "GET" SP Request-URI CRLF
Full-Request = Request-Line ; Section 5.1 Full-Request = Request-Line ; Section 5.1
*( General-Header ; Section 4.3 *( General-Header ; Section 4.3
| Request-Header ; Section 5.4 | Request-Header ; Section 5.2
| Entity-Header ) ; Section 7.1 | Entity-Header ) ; Section 7.1
CRLF CRLF
[ Entity-Body ] ; Section 7.2 [ Entity-Body ] ; Section 7.2
If an HTTP/1.0 server receives a Simple-Request, it must respond If an HTTP/1.0 server receives a Simple-Request, it must respond
with an HTTP/0.9 Simple-Response. An HTTP/1.0 client capable of with an HTTP/0.9 Simple-Response. An HTTP/1.0 client capable of
receiving a Full-Response should never generate a Simple-Request. receiving a Full-Response should never generate a Simple-Request.
5.1 Request-Line 5.1 Request-Line
The Request-Line begins with a method token, followed by the The Request-Line begins with a method token, followed by the
Request-URI and the protocol version, and ending with CRLF. The Request-URI and the protocol version, and ending with CRLF. The
elements are separated by SP characters. No CR or LF are allowed elements are separated by SP characters. No CR or LF are allowed
except in the final CRLF sequence. except in the final CRLF sequence.
Request-Line = Method SP Request-URI SP HTTP-Version CRLF Request-Line = Method SP Request-URI SP HTTP-Version CRLF
Note that the difference between a Simple-Request and the Note that the difference between a Simple-Request and the
Request-Line of a Full-Request is the presence of the HTTP-Version Request-Line of a Full-Request is the presence of the HTTP-Version
field and the availability of methods other than GET. field and the availability of methods other than GET.
5.2 Method 5.1.1 Method
The Method token indicates the method to be performed on the The Method token indicates the method to be performed on the
resource identified by the Request-URI. The method is resource identified by the Request-URI. The method is
case-sensitive. case-sensitive.
Method = "GET" | "HEAD" | "POST" Method = "GET" ; Section 8.1
| extension-method | "HEAD" ; Section 8.2
| "POST" ; Section 8.3
| extension-method
extension-method = token extension-method = token
The list of methods acceptable by a specific resource can change The list of methods acceptable by a specific resource can change
dynamically; the client is notified through the return code of the dynamically; the client is notified through the return code of the
response if a method is not allowed on a resource. Servers should response if a method is not allowed on a resource. Servers should
return the status code 501 (not implemented) if the method is return the status code 501 (not implemented) if the method is
unknown or not implemented. unknown or not implemented.
The set of common methods for HTTP/1.0 is described below. Although The methods commonly used by HTTP/1.0 applications are fully
this set can be easily expanded, additional methods cannot be defined in Section 8.
assumed to share the same semantics for separately extended clients
and servers.
5.2.1 GET
The GET method means retrieve whatever information (in the form of
an entity) is identified by the Request-URI. If the Request-URI
refers to a data-producing process, it is the produced data which
shall be returned as the entity in the response and not the source
text of the process, unless that text happens to be the output of
the process.
The semantics of the GET method changes to a "conditional GET" if
the request message includes an If-Modified-Since header field. A
conditional GET method requests that the identified resource be
transferred only if it has been modified since the date given by
the If-Modified-Since header, as described in Section 8.9. The
conditional GET method is intended to reduce network usage by
allowing cached entities to be refreshed without requiring multiple
requests or transferring unnecessary data.
5.2.2 HEAD
The HEAD method is identical to GET except that the server must not
return any Entity-Body in the response. The metainformation
contained in the HTTP headers in response to a HEAD request should
be identical to the information sent in response to a GET request.
This method can be used for obtaining metainformation about the
resource identified by the Request-URI without transferring the
Entity-Body itself. This method is often used for testing hypertext
links for validity, accessibility, and recent modification.
There is no "conditional HEAD" request analogous to the conditional
GET. If an If-Modified-Since header field is included with a HEAD
request, it should be ignored.
5.2.3 POST
The POST method is used to request that the destination server
accept the entity enclosed in the request as a new subordinate of
the resource identified by the Request-URI in the Request-Line.
POST is designed to allow a uniform method to cover the following
functions:
o Annotation of existing resources;
o Posting a message to a bulletin board, newsgroup, mailing list,
or similar group of articles;
o Providing a block of data, such as the result of submitting a
form [3], to a data-handling process;
o Extending a database through an append operation.
The actual function performed by the POST method is determined by
the server and is usually dependent on the Request-URI. The posted
entity is subordinate to that URI in the same way that a file is
subordinate to a directory containing it, a news article is
subordinate to a newsgroup to which it is posted, or a record is
subordinate to a database.
A successful POST does not require that the entity be created as a
resource on the origin server or made accessible for future
reference. That is, the action performed by the POST method might
not result in a resource that can be identified by a URI. In this
case, either 200 (ok) or 204 (no content) is the appropriate
response status, depending on whether or not the response includes
an entity that describes the result.
If a resource has been created on the origin server, the response
should be 201 (created) and contain an entity (preferably of type
"text/html") which describes the status of the request and refers
to the new resource.
A valid Content-Length is required on all HTTP/1.0 POST requests.
An HTTP/1.0 server should respond with a 400 (bad request) message
if it cannot determine the length of the request message's content.
Caching intermediaries must not cache responses to a POST request.
5.3 Request-URI 5.1.2 Request-URI
The Request-URI is a Uniform Resource Identifier (Section 3.2) and The Request-URI is a Uniform Resource Identifier (Section 3.2) and
identifies the resource upon which to apply the request. identifies the resource upon which to apply the request.
Request-URI = absoluteURI | abs_path Request-URI = absoluteURI | abs_path
The two options for Request-URI are dependent on the nature of the The two options for Request-URI are dependent on the nature of the
request. request.
The absoluteURI form is only allowed when the request is being made The absoluteURI form is only allowed when the request is being made
to a proxy server. The proxy is requested to forward the request to a proxy. The proxy is requested to forward the request and
and return the response. If the request is GET or HEAD and a return the response. If the request is GET or HEAD and a prior
response is cached, the proxy may use the cached message if it response is cached, the proxy may use the cached message if it
passes any restrictions in the Expires header field. Note that the passes any restrictions in the Expires header field. Note that the
proxy may forward the request on to another proxy or directly to proxy may forward the request on to another proxy or directly to
the origin server specified by the absoluteURI. In order to avoid the server specified by the absoluteURI. In order to avoid request
request loops, a proxy must be able to recognize all of its server loops, a proxy must be able to recognize all of its server names,
names, including any aliases, local variations, and the numeric IP including any aliases, local variations, and the numeric IP
address. An example Request-Line would be: address. An example Request-Line would be:
GET http://www.w3.org/hypertext/WWW/TheProject.html HTTP/1.0 GET http://www.w3.org/hypertext/WWW/TheProject.html HTTP/1.0
The most common form of Request-URI is that used to identify a The most common form of Request-URI is that used to identify a
resource on an origin server. In this case, only the absolute path resource on an origin server or gateway. In this case, only the
of the URI is transmitted (see Section 3.2.1, abs_path). For absolute path of the URI is transmitted (see Section 3.2.1,
example, a client wishing to retrieve the resource above directly abs_path). For example, a client wishing to retrieve the resource
from the origin server would create a TCP connection to port 80 of above directly from the origin server would create a TCP connection
the host "www.w3.org" and send the line: to port 80 of the host "www.w3.org" and send the line:
GET /hypertext/WWW/TheProject.html HTTP/1.0 GET /hypertext/WWW/TheProject.html HTTP/1.0
followed by the remainder of the Full-Request. Note that the followed by the remainder of the Full-Request. Note that the
absolute path cannot be empty; if none is present in the original absolute path cannot be empty; if none is present in the original
URI, it must be given as "/" (the server root). URI, it must be given as "/" (the server root).
5.4 Request Header Fields The Request-URI is transmitted as an encoded string, where some
characters may be escaped using the "% hex hex" encoding defined by
RFC 1738 [4]. The origin server must decode the Request-URI in
order to properly interpret the request.
5.2 Request Header Fields
The request header fields allow the client to pass additional The request header fields allow the client to pass additional
information about the request, and about the client itself, to the information about the request, and about the client itself, to the
server. All header fields are optional and conform to the generic server. All header fields are optional and conform to the generic
HTTP-header syntax. HTTP-header syntax.
Request-Header = Authorization ; Section 8.2 Request-Header = Authorization ; Section 10.2
| From ; Section 8.8 | From ; Section 10.8
| If-Modified-Since ; Section 8.9 | If-Modified-Since ; Section 10.9
| Referer ; Section 8.14 | Referer ; Section 10.14
| User-Agent ; Section 8.16 | User-Agent ; Section 10.16
Request-Header field names can be extended only via a change in the Request-Header field names can be extended reliably only in
protocol version. Unknown header fields are treated as combination with a change in the protocol version. However, new or
experimental header fields may be given the semantics of request
header fields if all parties in the communication recognize them to
be request header fields. Unknown header fields are treated as
Entity-Header fields. Entity-Header fields.
6. Response 6. Response
After receiving and interpreting a request message, a server After receiving and interpreting a request message, a server
responds in the form of an HTTP response message. responds in the form of an HTTP response message.
Response = Simple-Response | Full-Response Response = Simple-Response | Full-Response
Simple-Response= [ Entity-Body ] Simple-Response = [ Entity-Body ]
Full-Response = Status-Line ; Section 6.1 Full-Response = Status-Line ; Section 6.1
*( General-Header ; Section 4.3 *( General-Header ; Section 4.3
| Response-Header ; Section 6.3 | Response-Header ; Section 6.2
| Entity-Header ) ; Section 7.1 | Entity-Header ) ; Section 7.1
CRLF CRLF
[ Entity-Body ] ; Section 7.2 [ Entity-Body ] ; Section 7.2
A Simple-Response should only be sent in response to an HTTP/0.9 A Simple-Response should only be sent in response to an HTTP/0.9
Simple-Request or if the server only supports the more limited Simple-Request or if the server only supports the more limited
HTTP/0.9 protocol. If a client sends an HTTP/1.0 Full-Request and HTTP/0.9 protocol. If a client sends an HTTP/1.0 Full-Request and
receives a response that does not begin with a Status-Line, it receives a response that does not begin with a Status-Line, it
should assume that the response is a Simple-Response and parse it should assume that the response is a Simple-Response and parse it
accordingly. Note that the Simple-Response consists only of the accordingly. Note that the Simple-Response consists only of the
entity body and is terminated by the server closing the connection. entity body and is terminated by the server closing the connection.
6.1 Status-Line 6.1 Status-Line
skipping to change at line 1233 skipping to change at line 1258
"HTTP/" 1*DIGIT "." 1*DIGIT SP 3DIGIT SP "HTTP/" 1*DIGIT "." 1*DIGIT SP 3DIGIT SP
(e.g., "HTTP/1.0 200 "), the presence of that expression is (e.g., "HTTP/1.0 200 "), the presence of that expression is
sufficient to differentiate a Full-Response from a Simple-Response. sufficient to differentiate a Full-Response from a Simple-Response.
Although the Simple-Response format may allow such an expression to Although the Simple-Response format may allow such an expression to
occur at the beginning of an entity body, and thus cause a occur at the beginning of an entity body, and thus cause a
misinterpretation of the message if it was given in response to a misinterpretation of the message if it was given in response to a
Full-Request, most HTTP/0.9 servers are limited to responses of Full-Request, most HTTP/0.9 servers are limited to responses of
type "text/html" and therefore would never generate such a response. type "text/html" and therefore would never generate such a response.
6.2 Status Codes and Reason Phrases 6.1.1 Status Code and Reason Phrase
The Status-Code element is a 3-digit integer result code of the The Status-Code element is a 3-digit integer result code of the
attempt to understand and satisfy the request. The Reason-Phrase is attempt to understand and satisfy the request. The Reason-Phrase is
intended to give a short textual description of the Status-Code. intended to give a short textual description of the Status-Code.
The Status-Code is intended for use by automata and the The Status-Code is intended for use by automata and the
Reason-Phrase is intended for the human user. The client is not Reason-Phrase is intended for the human user. The client is not
required to examine or display the Reason-Phrase. required to examine or display the Reason-Phrase.
The first digit of the Status-Code defines the class of response. The first digit of the Status-Code defines the class of response.
The last two digits do not have any categorization role. There are The last two digits do not have any categorization role. There are
skipping to change at line 1264 skipping to change at line 1289
o 4xx: Client Error - The request contains bad syntax or cannot o 4xx: Client Error - The request contains bad syntax or cannot
be fulfilled be fulfilled
o 5xx: Server Error - The server failed to fulfill an apparently o 5xx: Server Error - The server failed to fulfill an apparently
valid request valid request
The individual values of the numeric status codes defined for The individual values of the numeric status codes defined for
HTTP/1.0, and an example set of corresponding Reason-Phrase's, are HTTP/1.0, and an example set of corresponding Reason-Phrase's, are
presented below. The reason phrases listed here are only presented below. The reason phrases listed here are only
recommended -- they may be replaced by local equivalents without recommended -- they may be replaced by local equivalents without
affecting the protocol. affecting the protocol. These codes are fully defined in Section 9.
Status-Code = "200" ; OK Status-Code = "200" ; OK
| "201" ; Created | "201" ; Created
| "202" ; Accepted | "202" ; Accepted
| "204" ; No Content | "204" ; No Content
| "301" ; Moved Permanently | "301" ; Moved Permanently
| "302" ; Moved Temporarily | "302" ; Moved Temporarily
| "304" ; Not Modified | "304" ; Not Modified
| "400" ; Bad Request | "400" ; Bad Request
| "401" ; Unauthorized | "401" ; Unauthorized
| "403" ; Forbidden | "403" ; Forbidden
| "404" ; Not Found | "404" ; Not Found
| "500" ; Internal Server Error | "500" ; Internal Server Error
| "501" ; Not Implemented | "501" ; Not Implemented
| "502" ; Bad Gateway | "502" ; Bad Gateway
| "503" ; Service Unavailable | "503" ; Service Unavailable
| extension-code | extension-code
extension-code = 3DIGIT extension-code = 3DIGIT
Reason-Phrase = *<text, excluding CR, LF> Reason-Phrase = *<TEXT, excluding CR, LF>
HTTP status codes are extensible, but the above codes are the only HTTP status codes are extensible, but the above codes are the only
ones generally recognized in current practice. HTTP applications ones generally recognized in current practice. HTTP applications
are not required to understand the meaning of all registered status are not required to understand the meaning of all registered status
codes, though such understanding is obviously desirable. However, codes, though such understanding is obviously desirable. However,
applications must understand the class of any status code, as applications must understand the class of any status code, as
indicated by the first digit, and treat any unknown response as indicated by the first digit, and treat any unknown response as
being equivalent to the x00 status code of that class. For example, being equivalent to the x00 status code of that class. For example,
if an unknown status code of 421 is received by the client, it can if an unknown status code of 421 is received by the client, it can
safely assume that there was something wrong with its request and safely assume that there was something wrong with its request and
treat the response as if it had received a 400 status code. In such treat the response as if it had received a 400 status code. In such
cases, user agents are encouraged to present the entity returned cases, user agents should present to the user the entity returned
with the response to the user, since that entity is likely to with the response, since that entity is likely to include
include human-readable information which will explain the unusual human-readable information which will explain the unusual status.
status.
6.2 Response Header Fields
The response header fields allow the server to pass additional
information about the response which cannot be placed in the
Status-Line. These header fields are not intended to give
information about an Entity-Body returned in the response, but
about the server itself.
Response-Header = Location ; Section 10.11
| Server ; Section 10.15
| WWW-Authenticate ; Section 10.17
Response-Header field names can be extended reliably only in
combination with a change in the protocol version. However, new or
experimental header fields may be given the semantics of response
header fields if all parties in the communication recognize them to
be response header fields. Unknown header fields are treated as
Entity-Header fields.
7. Entity
Full-Request and Full-Response messages may transfer an entity
within some requests and responses. An entity consists of
Entity-Header fields and (usually) an Entity-Body. In this section,
both sender and recipient refer to either the client or the server,
depending on who sends and who receives the entity.
7.1 Entity Header Fields
Entity-Header fields define optional metainformation about the
Entity-Body or, if no body is present, about the resource
identified by the request.
Entity-Header = Allow ; Section 10.1
| Content-Encoding ; Section 10.3
| Content-Length ; Section 10.4
| Content-Type ; Section 10.5
| Expires ; Section 10.7
| Last-Modified ; Section 10.10
| extension-header
extension-header = HTTP-header
The extension-header mechanism allows additional Entity-Header
fields to be defined without changing the protocol, but these
fields cannot be assumed to be recognizable by the recipient.
Unknown header fields should be ignored by the recipient and
forwarded by proxies.
7.2 Entity Body
The entity body (if any) sent with an HTTP/1.0 request or response
is in a format and encoding defined by the Entity-Header fields.
Entity-Body = *OCTET
An entity body is included with a request message only when the
request method calls for one. The presence of an entity body in a
request is signaled by the inclusion of a Content-Length header
field in the request message headers. HTTP/1.0 requests containing
an entity body must include a valid Content-Length header field.
For response messages, whether or not an entity body is included
with a message is dependent on both the request method and the
response code. All responses to the HEAD request method must not
include a body, even though the presence of entity header fields
may lead one to believe they do. All 1xx (informational), 204 (no
content), and 304 (not modified) responses must not include a body.
All other responses must include an entity body or a Content-Length
header field defined with a value of zero (0).
7.2.1 Type
When an Entity-Body is included with a message, the data type of
that body is determined via the header fields Content-Type and
Content-Encoding. These define a two-layer, ordered encoding model:
entity-body := Content-Encoding( Content-Type( data ) )
A Content-Type specifies the media type of the underlying data. A
Content-Encoding may be used to indicate any additional content
coding applied to the type, usually for the purpose of data
compression, that is a property of the resource requested. The
default for the content encoding is none (i.e., the identity
function).
Any HTTP/1.0 message containing an entity body should include a
Content-Type header field defining the media type of that body. If
and only if the media type is not given by a Content-Type header,
as is the case for Simple-Response messages, the recipient may
attempt to guess the media type via inspection of its content
and/or the name extension(s) of the URL used to identify the
resource. If the media type remains unknown, the recipient should
treat it as type "application/octet-stream".
7.2.2 Length
When an Entity-Body is included with a message, the length of that
body may be determined in one of two ways. If a Content-Length
header field is present, its value in bytes represents the length
of the Entity-Body. Otherwise, the body length is determined by the
closing of the connection by the server.
Closing the connection cannot be used to indicate the end of a
request body, since it leaves no possibility for the server to send
back a response. Therefore, HTTP/1.0 requests containing an entity
body must include a valid Content-Length header field. If a request
contains an entity body and Content-Length is not specified, and
the server does not recognize or cannot calculate the length from
other fields, then the server should send a 400 (bad request)
response.
Note: Some older servers supply an invalid Content-Length
when sending a document that contains server-side includes
dynamically inserted into the data stream. It must be
emphasized that this will not be tolerated by future
versions of HTTP. Unless the client knows that it is
receiving a response from a compliant server, it should not
depend on the Content-Length value being correct.
8. Method Definitions
The set of common methods for HTTP/1.0 is defined below. Although
this set can be expanded, additional methods cannot be assumed to
share the same semantics for separately extended clients and
servers.
8.1 GET
The GET method means retrieve whatever information (in the form of
an entity) is identified by the Request-URI. If the Request-URI
refers to a data-producing process, it is the produced data which
shall be returned as the entity in the response and not the source
text of the process, unless that text happens to be the output of
the process.
The semantics of the GET method changes to a "conditional GET" if
the request message includes an If-Modified-Since header field. A
conditional GET method requests that the identified resource be
transferred only if it has been modified since the date given by
the If-Modified-Since header, as described in Section 10.9. The
conditional GET method is intended to reduce network usage by
allowing cached entities to be refreshed without requiring multiple
requests or transferring unnecessary data.
8.2 HEAD
The HEAD method is identical to GET except that the server must not
return any Entity-Body in the response. The metainformation
contained in the HTTP headers in response to a HEAD request should
be identical to the information sent in response to a GET request.
This method can be used for obtaining metainformation about the
resource identified by the Request-URI without transferring the
Entity-Body itself. This method is often used for testing hypertext
links for validity, accessibility, and recent modification.
There is no "conditional HEAD" request analogous to the conditional
GET. If an If-Modified-Since header field is included with a HEAD
request, it should be ignored.
8.3 POST
The POST method is used to request that the destination server
accept the entity enclosed in the request as a new subordinate of
the resource identified by the Request-URI in the Request-Line.
POST is designed to allow a uniform method to cover the following
functions:
o Annotation of existing resources;
o Posting a message to a bulletin board, newsgroup, mailing list,
or similar group of articles;
o Providing a block of data, such as the result of submitting a
form [3], to a data-handling process;
o Extending a database through an append operation.
The actual function performed by the POST method is determined by
the server and is usually dependent on the Request-URI. The posted
entity is subordinate to that URI in the same way that a file is
subordinate to a directory containing it, a news article is
subordinate to a newsgroup to which it is posted, or a record is
subordinate to a database.
A successful POST does not require that the entity be created as a
resource on the origin server or made accessible for future
reference. That is, the action performed by the POST method might
not result in a resource that can be identified by a URI. In this
case, either 200 (ok) or 204 (no content) is the appropriate
response status, depending on whether or not the response includes
an entity that describes the result.
If a resource has been created on the origin server, the response
should be 201 (created) and contain an entity (preferably of type
"text/html") which describes the status of the request and refers
to the new resource.
A valid Content-Length is required on all HTTP/1.0 POST requests.
An HTTP/1.0 server should respond with a 400 (bad request) message
if it cannot determine the length of the request message's content.
Applications must not cache responses to a POST request.
9. Status Code Definitions
Each Status-Code is described below, including a description of Each Status-Code is described below, including a description of
which method(s) it can follow and any metainformation required in which method(s) it can follow and any metainformation required in
the response. the response.
6.2.1 Informational 1xx 9.1 Informational 1xx
This class of status code indicates a provisional response, This class of status code indicates a provisional response,
consisting only of the Status-Line and optional headers, and is consisting only of the Status-Line and optional headers, and is
terminated by an empty line. HTTP/1.0 does not define any 1xx terminated by an empty line. HTTP/1.0 does not define any 1xx
status codes and they are not a valid response to a HTTP/1.0 status codes and they are not a valid response to a HTTP/1.0
request. However, they may be useful for experimental applications request. However, they may be useful for experimental applications
which are outside the scope of this specification. which are outside the scope of this specification.
6.2.2 Successful 2xx 9.2 Successful 2xx
This class of status code indicates that the client's request was This class of status code indicates that the client's request was
successfully received, understood, and accepted. successfully received, understood, and accepted.
200 OK 200 OK
The request has succeeded. The information returned with the The request has succeeded. The information returned with the
response is dependent on the method used in the request, as follows: response is dependent on the method used in the request, as follows:
GET an entity corresponding to the requested resource is being GET an entity corresponding to the requested resource is sent
sent in the response; in the response;
HEAD the response must only contain the header information and HEAD the response must only contain the header information and
no Entity-Body; no Entity-Body;
POST an entity describing or containing the result of the action. POST an entity describing or containing the result of the action.
201 Created 201 Created
The request has been fulfilled and resulted in a new resource being The request has been fulfilled and resulted in a new resource being
created. The newly created resource can be referenced by the URI(s) created. The newly created resource can be referenced by the URI(s)
returned in the entity of the response. The origin server is returned in the entity of the response. The origin server should
encouraged, but not obliged, to actually create the resource before create the resource before using this Status-Code. If the action
using this Status-Code. If the action cannot be carried out cannot be carried out immediately, the server must include in the
immediately, or within a clearly defined timeframe, the server response body a description of when the resource will be available;
should respond with 202 (accepted) instead. otherwise, the server should respond with 202 (accepted).
Of the methods defined by this specification, only POST can create Of the methods defined by this specification, only POST can create
a resource. a resource.
202 Accepted 202 Accepted
The request has been accepted for processing, but the processing The request has been accepted for processing, but the processing
has not been completed. The request may or may not eventually be has not been completed. The request may or may not eventually be
acted upon, as it may be disallowed when processing actually takes acted upon, as it may be disallowed when processing actually takes
place. There is no facility for re-sending a status code from an place. There is no facility for re-sending a status code from an
skipping to change at line 1374 skipping to change at line 1604
The server has fulfilled the request but there is no new The server has fulfilled the request but there is no new
information to send back. If the client is a user agent, it should information to send back. If the client is a user agent, it should
not change its document view from that which caused the request to not change its document view from that which caused the request to
be generated. This response is primarily intended to allow input be generated. This response is primarily intended to allow input
for scripts or other actions to take place without causing a change for scripts or other actions to take place without causing a change
to the user agent's active document view. The response may include to the user agent's active document view. The response may include
new metainformation in the form of entity headers, which should new metainformation in the form of entity headers, which should
apply to the document currently in the user agent's active view. apply to the document currently in the user agent's active view.
6.2.3 Redirection 3xx 9.3 Redirection 3xx
This class of status code indicates that further action needs to be This class of status code indicates that further action needs to be
taken by the user agent in order to fulfill the request. The action taken by the user agent in order to fulfill the request. The action
required can sometimes be carried out by the user agent without required can sometimes be carried out by the user agent without
interaction with the user, but it is strongly recommended that this interaction with the user, but it is strongly recommended that this
only take place if the method used in the request is GET or HEAD. A only take place if the method used in the request is GET or HEAD. A
user agent should never automatically redirect a request more than user agent should never automatically redirect a request more than
5 times, since such redirections usually indicate an infinite loop. 5 times, since such redirections usually indicate an infinite loop.
300 Multiple Choices 300 Multiple Choices
This response code is not directly used by HTTP/1.0 applications, This response code is not directly used by HTTP/1.0 applications,
but serves as the default for interpreting the 3xx class of but serves as the default for interpreting the 3xx class of
responses. responses.
The requested resource is available at one or more locations. The requested resource is available at one or more locations.
Unless it was a HEAD request, the response should include an entity Unless it was a HEAD request, the response should include an entity
containing a list of resource characteristics and locations from containing a list of resource characteristics and locations from
which the user or user agent can choose the one most appropriate. which the user or user agent can choose the one most appropriate.
If the server has a preferred choice, it should include the URL in If the server has a preferred choice, it should include the URL in
a Location field; user agents may use the Location value for a Location field; user agents may use this field value for
automatic redirection. automatic redirection.
301 Moved Permanently 301 Moved Permanently
The requested resource has been assigned a new permanent URL and The requested resource has been assigned a new permanent URL and
any future references to this resource should be done using that any future references to this resource should be done using that
URL. Clients with link editing capabilities are encouraged to URL. Clients with link editing capabilities should automatically
automatically relink references to the Request-URI to the new relink references to the Request-URI to the new reference returned
reference returned by the server, where possible. by the server, where possible.
The new URL must be given by the Location field in the response. The new URL must be given by the Location field in the response.
Unless it was a HEAD request, the Entity-Body of the response Unless it was a HEAD request, the Entity-Body of the response
should contain a short note with a hyperlink to the new URL. should contain a short note with a hyperlink to the new URL.
If the 301 status code is received in response to a request using If the 301 status code is received in response to a request using
the POST method, the user agent must not automatically redirect the the POST method, the user agent must not automatically redirect the
request unless it can be confirmed by the user, since this might request unless it can be confirmed by the user, since this might
change the conditions under which the request was issued. change the conditions under which the request was issued.
skipping to change at line 1434 skipping to change at line 1664
If the 302 status code is received in response to a request using If the 302 status code is received in response to a request using
the POST method, the user agent must not automatically redirect the the POST method, the user agent must not automatically redirect the
request unless it can be confirmed by the user, since this might request unless it can be confirmed by the user, since this might
change the conditions under which the request was issued. change the conditions under which the request was issued.
304 Not Modified 304 Not Modified
If the client has performed a conditional GET request and access is If the client has performed a conditional GET request and access is
allowed, but the document has not been modified since the date and allowed, but the document has not been modified since the date and
time specified in the If-Modified-Since field, the server shall time specified in the If-Modified-Since field, the server must
respond with this status code and not send an Entity-Body to the respond with this status code and not send an Entity-Body to the
client. Header fields contained in the response should only include client. Header fields contained in the response should only include
information which is relevant to cache managers and which may have information which is relevant to cache managers or which may have
changed independently of the entity's Last-Modified date. Examples changed independently of the entity's Last-Modified date. Examples
of relevant header fields include: Date, Server, and Expires. of relevant header fields include: Date, Server, and Expires. A
cache should update its cached entity to reflect any new field
values given in the 304 response.
6.2.4 Client Error 4xx 9.4 Client Error 4xx
The 4xx class of status code is intended for cases in which the The 4xx class of status code is intended for cases in which the
client seems to have erred. If the client has not completed the client seems to have erred. If the client has not completed the
request when a 4xx code is received, it should immediately cease request when a 4xx code is received, it should immediately cease
sending data to the server. Except when responding to a HEAD sending data to the server. Except when responding to a HEAD
request, the server is encouraged to include an entity containing request, the server should include an entity containing an
an explanation of the error situation, and whether it is a explanation of the error situation, and whether it is a temporary
temporary or permanent condition. These status codes are applicable or permanent condition. These status codes are applicable to any
to any request method. request method.
Note: If the client is sending data, server implementations Note: If the client is sending data, server implementations
on TCP should be careful to ensure that the client on TCP should be careful to ensure that the client
acknowledges receipt of the packet(s) containing the acknowledges receipt of the packet(s) containing the
response prior to closing the input connection. If the response prior to closing the input connection. If the
client continues sending data to the server after the close, client continues sending data to the server after the close,
the server's controller will send a reset packet to the the server's controller will send a reset packet to the
client, which may erase the client's unacknowledged input client, which may erase the client's unacknowledged input
buffers before they can be read and interpreted by the HTTP buffers before they can be read and interpreted by the HTTP
application. application.
400 Bad Request 400 Bad Request
The request could not be understood by the server due to malformed The request could not be understood by the server due to malformed
syntax. The client is discouraged from repeating the request syntax. The client should not repeat the request without
without modifications. modifications.
401 Unauthorized 401 Unauthorized
The request requires user authentication. The response must include The request requires user authentication. The response must include
a WWW-Authenticate header field (Section 8.17) containing a a WWW-Authenticate header field (Section 10.17) containing a
challenge applicable to the requested resource. The client may challenge applicable to the requested resource. The client may
repeat the request with a suitable Authorization header field. If repeat the request with a suitable Authorization header field
the request already included Authorization credentials, then the (Section 10.2). If the request already included Authorization
401 response indicates that authorization has been refused for credentials, then the 401 response indicates that authorization has
those credentials. If the 401 response contains the same challenge been refused for those credentials. If the 401 response contains
as the prior response, and the user agent has already attempted the same challenge as the prior response, and the user agent has
authentication at least once, then the user should be presented the already attempted authentication at least once, then the user
entity that was given in the response, since that entity may should be presented the entity that was given in the response,
include relevent diagnostic information. HTTP access authentication since that entity may include relevent diagnostic information. HTTP
is explained in Section 9. access authentication is explained in Section 11.
403 Forbidden 403 Forbidden
The server understood the request, but is refusing to perform the The server understood the request, but is refusing to fulfill it.
request for an unspecified reason. Authorization will not help and Authorization will not help and the request should not be repeated.
the request should not be repeated. This status code can be used if If the request method was not HEAD and the server wishes to make
the server does not want to make public why the request has not public why the request has not been fulfilled, it should describe
been fulfilled. the reason for the refusal in the entity body. This status code is
commonly used when the server does not wish to reveal exactly why
the request has been refused, or when no other response is
applicable.
404 Not Found 404 Not Found
The server has not found anything matching the Request-URI. No The server has not found anything matching the Request-URI. No
indication is given of whether the condition is temporary or indication is given of whether the condition is temporary or
permanent. If the server does not wish to make this information permanent. If the server does not wish to make this information
available to the client, the status code 403 (forbidden) can be available to the client, the status code 403 (forbidden) can be
used instead. used instead.
6.2.5 Server Errors 5xx 9.5 Server Error 5xx
Response status codes beginning with the digit "5" indicate cases Response status codes beginning with the digit "5" indicate cases
in which the server is aware that it has erred or is incapable of in which the server is aware that it has erred or is incapable of
performing the request. If the client has not completed the request performing the request. If the client has not completed the request
when a 5xx code is received, it should immediately cease sending when a 5xx code is received, it should immediately cease sending
data to the server. Except when responding to a HEAD request, the data to the server. Except when responding to a HEAD request, the
server is encouraged to include an entity containing an explanation server should include an entity containing an explanation of the
of the error situation, and whether it is a temporary or permanent error situation, and whether it is a temporary or permanent
condition. These response codes are applicable to any request condition. These response codes are applicable to any request
method and there are no required header fields. method and there are no required header fields.
500 Internal Server Error 500 Internal Server Error
The server encountered an unexpected condition which prevented it The server encountered an unexpected condition which prevented it
from fulfilling the request. from fulfilling the request.
501 Not Implemented 501 Not Implemented
The server does not support the functionality required to fulfill The server does not support the functionality required to fulfill
the request. This is the appropriate response when the server does the request. This is the appropriate response when the server does
not recognize the request method and is not capable of supporting not recognize the request method and is not capable of supporting
it for any resource. it for any resource.
502 Bad Gateway 502 Bad Gateway
The server received an invalid response from the gateway or The server, while acting as a gateway or proxy, received an invalid
upstream server it accessed in attempting to fulfill the request. response from the upstream server it accessed in attempting to
fulfill the request.
503 Service Unavailable 503 Service Unavailable
The server is currently unable to handle the request due to a The server is currently unable to handle the request due to a
temporary overloading or maintenance of the server. The implication temporary overloading or maintenance of the server. The implication
is that this is a temporary condition which will be alleviated is that this is a temporary condition which will be alleviated
after some delay. after some delay.
Note: The existence of the 503 status code does not imply Note: The existence of the 503 status code does not imply
that a server must use it when becoming overloaded. Some that a server must use it when becoming overloaded. Some
servers may wish to simply refuse the connection. servers may wish to simply refuse the connection.
6.3 Response Header Fields 10. Header Field Definitions
The response header fields allow the server to pass additional
information about the response which cannot be placed in the
Status-Line. These header fields are not intended to give
information about an Entity-Body returned in the response, but
about the server itself.
Response-Header = Location ; Section 8.11
| Server ; Section 8.15
| WWW-Authenticate ; Section 8.17
Response-Header field names can be extended only via a change in
the protocol version. Unknown header fields are treated as
Entity-Header fields.
7. Entity
Full-Request and Full-Response messages may transfer an entity
within some requests and responses. An entity consists of
Entity-Header fields and (usually) an Entity-Body. In this section,
both sender and recipient refer to either the client or the server,
depending on who sends and who receives the entity.
7.1 Entity Header Fields
Entity-Header fields define optional metainformation about the
Entity-Body or, if no body is present, about the resource
identified by the request.
Entity-Header = Allow ; Section 8.1
| Content-Encoding ; Section 8.3
| Content-Length ; Section 8.4
| Content-Type ; Section 8.5
| Expires ; Section 8.7
| Last-Modified ; Section 8.10
| extension-header
extension-header=HTTP-header
The extension-header mechanism allows additional Entity-Header to
be defined without changing the protocol, but these fields cannot
be assumed to be recognizable by the recipient. Unknown header
fields should be ignored by the recipient and forwarded by proxies.
7.2 Entity Body
The entity-body (if any) sent with an HTTP/1.0 request or response
is in a format and encoding defined by the Entity-Header fields.
Entity-Body = *OCTET
An entity-body is included with a request message only when the
request method calls for one. This specification defines one
request method, POST, that allows an entity-body. In general, the
presence of an entity-body in a request is signaled by the
inclusion of a Content-Length header field in the request message
headers. HTTP/1.0 requests containing content must include a valid
Content-Length header field.
For response messages, whether or not an entity-body is included
with a message is dependent on both the request method and the
response code. All responses to the HEAD request method must not
include a body, even though the presence of content header fields
may lead one to believe they do. The responses 204 (no content) and
304 (not modified) must not include a message body.
7.2.1 Type
When an Entity-Body is included with a message, the data type of
that body is determined via the header fields Content-Type and
Content-Encoding. These define a two-layer, ordered encoding model:
entity-body := Content-Encoding( Content-Type( data ) )
A Content-Type specifies the media type of the underlying data. A
Content-Encoding may be used to indicate any additional content
coding applied to the type, usually for the purpose of data
compression, that is a property of the resource requested. The
default for the content encoding is none (i.e., the identity
function).
The Content-Type header field has no default value. If and only if
the media type is not given by a Content-Type header, as is always
the case for Simple-Response messages, the receiver may attempt to
guess the media type via inspection of its content and/or the name
extension(s) of the URL used to specify the resource. If the media
type remains unknown, the receiver should treat it as type
"application/octet-stream".
7.2.2 Length
When an Entity-Body is included with a message, the length of that
body may be determined in one of several ways. If a Content-Length
header field is present, its value in bytes represents the length
of the Entity-Body. Otherwise, the body length is determined by the
closing of the connection by the server.
Closing the connection cannot be used to indicate the end of a
request body, since it leaves no possibility for the server to send
back a response. Therefore, HTTP/1.0 requests containing content
must include a valid Content-Length header field. If a request
contains an entity body and Content-Length is not specified, and
the server does not recognize or cannot calculate the length from
other fields, then the server should send a 400 (bad request)
response.
Note: Some older servers supply an invalid Content-Length
when sending a document that contains server-side includes
dynamically inserted into the data stream. It must be
emphasized that this will not be tolerated by future
versions of HTTP. Unless the client knows that it is
receiving a response from a compliant server, it should not
depend on the Content-Length value being correct.
8. Header Field Definitions
This section defines the syntax and semantics of all standard This section defines the syntax and semantics of all commonly used
HTTP/1.0 header fields. For Entity-Header fields, both sender and HTTP/1.0 header fields. For general and entity header fields, both
recipient refer to either the client or the server, depending on sender and recipient refer to either the client or the server,
who sends and who receives the entity. depending on who sends and who receives the message.
8.1 Allow 10.1 Allow
The Allow header field lists the set of methods supported by the The Allow entity-header field lists the set of methods supported by
resource identified by the Request-URI. The purpose of this field the resource identified by the Request-URI. The purpose of this
is strictly to inform the recipient of valid methods associated field is strictly to inform the recipient of valid methods
with the resource. The Allow header field is not permitted in a associated with the resource. The Allow header field is not
request using the POST method, and thus should be ignored if it is permitted in a request using the POST method, and thus should be
received as part of a POST entity. ignored if it is received as part of a POST entity.
Allow = "Allow" ":" 1#method Allow = "Allow" ":" 1#method
Example of use: Example of use:
Allow: GET, HEAD Allow: GET, HEAD
This field cannot prevent a client from trying other methods. This field cannot prevent a client from trying other methods.
However, the indications given by the Allow field value should be However, the indications given by the Allow header field value
followed. This field has no default value; if left undefined, the should be followed. The actual set of allowed methods is defined by
set of allowed methods is defined by the origin server at the time the origin server at the time of each request.
of each request.
A proxy must not modify the allow header even if it does not A proxy must not modify the Allow header field even if it does not
understand all the methods specified, since the user agent may have understand all the methods specified, since the user agent may have
other means of communicating with the origin server. other means of communicating with the origin server.
The Allow header field does not indicate what methods are The Allow header field does not indicate what methods are
implemented by the server. implemented by the server.
8.2 Authorization 10.2 Authorization
A user agent that wishes to authenticate itself with a A user agent that wishes to authenticate itself with a
server--usually, but not necessarily, after receiving a 401 server--usually, but not necessarily, after receiving a 401
response--may do so by including an Authorization header field with response--may do so by including an Authorization request-header
the request. The Authorization field value consists of credentials field with the request. The Authorization field value consists of
containing the authentication information of the user agent for the credentials containing the authentication information of the user
realm of the resource being requested. agent for the realm of the resource being requested.
Authorization = "Authorization" ":" credentials Authorization = "Authorization" ":" credentials
HTTP access authentication is described in Section 9. If a request HTTP access authentication is described in Section 11. If a request
is authenticated and a realm specified, the same credentials should is authenticated and a realm specified, the same credentials should
be valid for all other requests within this realm. be valid for all other requests within this realm.
Proxies must not cache the response to a request containing an Responses to requests containing an Authorization field are not
Authorization field. cachable.
8.3 Content-Encoding 10.3 Content-Encoding
The Content-Encoding header field is used as a modifier to the The Content-Encoding entity-header field is used as a modifier to
media-type. When present, its value indicates what additional the media-type. When present, its value indicates what additional
content coding has been applied to the resource, and thus what content coding has been applied to the resource, and thus what
decoding mechanism must be applied in order to obtain the decoding mechanism must be applied in order to obtain the
media-type referenced by the Content-Type header field. The media-type referenced by the Content-Type header field. The
Content-Encoding is primarily used to allow a document to be Content-Encoding is primarily used to allow a document to be
compressed without losing the identity of its underlying media type. compressed without losing the identity of its underlying media type.
Content-Encoding = "Content-Encoding" ":" content-coding Content-Encoding = "Content-Encoding" ":" content-coding
Content codings are defined in Section 3.5. An example of its use is Content codings are defined in Section 3.5. An example of its use is
Content-Encoding: x-gzip Content-Encoding: x-gzip
The Content-Encoding is a characteristic of the resource identified The Content-Encoding is a characteristic of the resource identified
by the Request-URI. Typically, the resource is stored with this by the Request-URI. Typically, the resource is stored with this
encoding and is only decoded before rendering or analogous usage. encoding and is only decoded before rendering or analogous usage.
8.4 Content-Length 10.4 Content-Length
The Content-Length header field indicates the size of the The Content-Length entity-header field indicates the size of the
Entity-Body, in decimal number of octets, sent to the recipient or, Entity-Body, in decimal number of octets, sent to the recipient or,
in the case of the HEAD method, the size of the Entity-Body that in the case of the HEAD method, the size of the Entity-Body that
would have been sent had the request been a GET. would have been sent had the request been a GET.
Content-Length = "Content-Length" ":" 1*DIGIT Content-Length = "Content-Length" ":" 1*DIGIT
An example is An example is
Content-Length: 3495 Content-Length: 3495
Although it is not required, applications are strongly encouraged Applications should use this field to indicate the size of the
to use this field to indicate the size of the Entity-Body to be Entity-Body to be transferred, regardless of the media type of the
transferred, regardless of the media type of the entity. entity. A valid Content-Length field value is required on all
HTTP/1.0 request messages containing an entity body.
Any Content-Length greater than or equal to zero is a valid value. Any Content-Length greater than or equal to zero is a valid value.
Section 7.2.2 describes how to determine the length of an Section 7.2.2 describes how to determine the length of a response
Entity-Body if a Content-Length is not given. entity body if a Content-Length is not given.
Note: The meaning of this field is significantly different Note: The meaning of this field is significantly different
from the corresponding definition in MIME, where it is an from the corresponding definition in MIME, where it is an
optional field used within the "message/external-body" optional field used within the "message/external-body"
content-type. In HTTP, it should be used whenever the content-type. In HTTP, it should be used whenever the
entity's length can be determined prior to being transferred. entity's length can be determined prior to being transferred.
8.5 Content-Type 10.5 Content-Type
The Content-Type header field indicates the media type of the The Content-Type entity-header field indicates the media type of
Entity-Body sent to the recipient or, in the case of the HEAD the Entity-Body sent to the recipient or, in the case of the HEAD
method, the media type that would have been sent had the request method, the media type that would have been sent had the request
been a GET. been a GET.
Content-Type = "Content-Type" ":" media-type Content-Type = "Content-Type" ":" media-type
Media types are defined in Section 3.6. An example of the field is Media types are defined in Section 3.6. An example of the field is
Content-Type: text/html Content-Type: text/html
The Content-Type header field has no default value. Further Further discussion of methods for identifying the media type of an
discussion of methods for identifying the media type of an entity entity is provided in Section 7.2.1.
is provided in Section 7.2.1.
8.6 Date 10.6 Date
The Date header represents the date and time at which the message The Date general-header field represents the date and time at which
was originated, having the same semantics as orig-date in RFC 822. the message was originated, having the same semantics as orig-date
The field value is an HTTP-date, as described in Section 3.3. in RFC 822. The field value is an HTTP-date, as described in
Section 3.3.
Date = "Date" ":" HTTP-date Date = "Date" ":" HTTP-date
An example is An example is
Date: Tue, 15 Nov 1994 08:12:31 GMT Date: Tue, 15 Nov 1994 08:12:31 GMT
If a message is received via direct connection with the user agent If a message is received via direct connection with the user agent
(in the case of requests) or the origin server (in the case of (in the case of requests) or the origin server (in the case of
responses), then the default date can be assumed to be the current responses), then the date can be assumed to be the current date at
date at the receiving end. However, since the date--as it is the receiving end. However, since the date--as it is believed by the
believed by the origin--is important for evaluating cached origin--is important for evaluating cached responses, origin servers
responses, origin servers should always include a Date header. should always include a Date header. Clients should only send a
Clients should only send a Date header field in messages that Date header field in messages that include an entity body, as in
include an entity body, as in the case of the POST request, and the case of the POST request, and even then it is optional. A
even then it is optional. A received message which does not have a received message which does not have a Date header field should be
Date header field should be assigned one by the receiver if and assigned one by the recipient if the message will be cached by that
only if the message will be cached by that receiver or gatewayed recipient or gatewayed via a protocol which requires a Date.
via a protocol which requires a Date.
Only one Date header field is allowed per message. In theory, the In theory, the date should represent the moment just before the
date should represent the moment just before the entity is entity is generated. In practice, the date can be generated at any
generated. In practice, the date can be generated at any time time during the message origination without affecting its semantic
during the message origination without affecting its semantic value. value.
Note: An earlier version of this document incorrectly Note: An earlier version of this document incorrectly
specified that this field should contain the creation date specified that this field should contain the creation date
of the enclosed Entity-Body. This has been changed to of the enclosed Entity-Body. This has been changed to
reflect actual (and proper) usage. reflect actual (and proper) usage.
8.7 Expires 10.7 Expires
The Expires field gives the date/time after which the entity should The Expires entity-header field gives the date/time after which the
be considered stale. This allows information providers to suggest entity should be considered stale. This allows information
the volatility of the resource. Caching clients, including proxies, providers to suggest the volatility of the resource, or a date
must not cache this copy of the resource beyond the date given, after which the information may no longer be valid. Applications
unless its status has been updated by a later check of the origin must not cache this entity beyond the date given. The presence of
server. The presence of an Expires field does not imply that the an Expires field does not imply that the original resource will
original resource will change or cease to exist at, before, or change or cease to exist at, before, or after that time. However,
after that time. However, information providers that know or even information providers that know or even suspect that a resource
suspect that a resource will change by a certain date are strongly will change by a certain date should include an Expires header with
encouraged to include an Expires header with that date. The format that date. The format is an absolute date and time as defined by
is an absolute date and time as defined by HTTP-date in Section 3.3. HTTP-date in Section 3.3.
Expires = "Expires" ":" HTTP-date Expires = "Expires" ":" HTTP-date
An example of its use is An example of its use is
Expires: Thu, 01 Dec 1994 16:00:00 GMT Expires: Thu, 01 Dec 1994 16:00:00 GMT
The Expires field has no default value. If the date given is equal If the date given is equal to or earlier than the value of the Date
to or earlier than the value of the Date header, the recipient must header, the recipient must not cache the enclosed entity. If a
not cache the enclosed entity. If a resource is dynamic by nature, resource is dynamic by nature, as is the case with many
as is the case with many data-producing processes, copies of that data-producing processes, entities from that resource should be
resource should be given an appropriate Expires value which given an appropriate Expires value which reflects that dynamism.
reflects that dynamism.
The Expires field cannot be used to force a user agent to refresh The Expires field cannot be used to force a user agent to refresh
its display or reload a resource; its semantics apply only to its display or reload a resource; its semantics apply only to
caching mechanisms, and such mechanisms need only check a caching mechanisms, and such mechanisms need only check a
resource's expiration status when a new request for that resource resource's expiration status when a new request for that resource
is initiated. is initiated.
User agents often have history mechanisms, such as "Back" buttons User agents often have history mechanisms, such as "Back" buttons
and history lists, which can be used to redisplay an entity and history lists, which can be used to redisplay an entity
retrieved earlier in a session. By default, the Expires field does retrieved earlier in a session. By default, the Expires field does
skipping to change at line 1854 skipping to change at line 1973
expired, unless the user has specifically configured the agent to expired, unless the user has specifically configured the agent to
refresh expired history documents. refresh expired history documents.
Note: Applications are encouraged to be tolerant of bad or Note: Applications are encouraged to be tolerant of bad or
misinformed implementations of the Expires header. A value misinformed implementations of the Expires header. A value
of zero (0) or an invalid date format should be considered of zero (0) or an invalid date format should be considered
equivalent to an "expires immediately." Although these equivalent to an "expires immediately." Although these
values are not legitimate for HTTP/1.0, a robust values are not legitimate for HTTP/1.0, a robust
implementation is always desirable. implementation is always desirable.
8.8 From 10.8 From
The From header field, if given, should contain an Internet e-mail The From request-header field, if given, should contain an Internet
address for the human user who controls the requesting user agent. e-mail address for the human user who controls the requesting user
The address should be machine-usable, as defined by mailbox in agent. The address should be machine-usable, as defined by mailbox
RFC 822 [7] (as updated by RFC 1123 [6]): in RFC 822 [7] (as updated by RFC 1123 [6]):
From = "From" ":" mailbox From = "From" ":" mailbox
An example is: An example is:
From: webmaster@w3.org From: webmaster@w3.org
This header field may be used for logging purposes and as a means This header field may be used for logging purposes and as a means
for identifying the source of invalid or unwanted requests. It for identifying the source of invalid or unwanted requests. It
should not be used as an insecure form of access protection. The should not be used as an insecure form of access protection. The
skipping to change at line 1888 skipping to change at line 2007
is passed through a proxy, the original issuer's address should be is passed through a proxy, the original issuer's address should be
used. used.
Note: The client should not send the From header field Note: The client should not send the From header field
without the user's approval, as it may conflict with the without the user's approval, as it may conflict with the
user's privacy interests or their site's security policy. It user's privacy interests or their site's security policy. It
is strongly recommended that the user be able to disable, is strongly recommended that the user be able to disable,
enable, and modify the value of this field at any time prior enable, and modify the value of this field at any time prior
to a request. to a request.
8.9 If-Modified-Since 10.9 If-Modified-Since
The If-Modified-Since header field is used with the GET method to The If-Modified-Since request-header field is used with the GET
make it conditional: if the requested resource has not been method to make it conditional: if the requested resource has not
modified since the time specified in this field, a copy of the been modified since the time specified in this field, a copy of the
resource will not be returned from the server; instead, a 304 (not resource will not be returned from the server; instead, a 304 (not
modified) response will be returned without any Entity-Body. modified) response will be returned without any Entity-Body.
If-Modified-Since = "If-Modified-Since" ":" HTTP-date If-Modified-Since = "If-Modified-Since" ":" HTTP-date
An example of the field is: An example of the field is:
If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
A conditional GET method requests that the identified resource be A conditional GET method requests that the identified resource be
skipping to change at line 1924 skipping to change at line 2043
If-Modified-Since date, the response is exactly the same as If-Modified-Since date, the response is exactly the same as
for a normal GET. for a normal GET.
c) If the resource has not been modified since a valid c) If the resource has not been modified since a valid
If-Modified-Since date, the server shall return a 304 (not If-Modified-Since date, the server shall return a 304 (not
modified) response. modified) response.
The purpose of this feature is to allow efficient updates of cached The purpose of this feature is to allow efficient updates of cached
information with a minimum amount of transaction overhead. information with a minimum amount of transaction overhead.
8.10 Last-Modified 10.10 Last-Modified
The Last-Modified header field indicates the date and time at which The Last-Modified entity-header field indicates the date and time
the sender believes the resource was last modified. The exact at which the sender believes the resource was last modified. The
semantics of this field are defined in terms of how the receiver exact semantics of this field are defined in terms of how the
should interpret it: if the receiver has a copy of this resource recipient should interpret it: if the recipient has a copy of this
which is older than the date given by the Last-Modified field, that resource which is older than the date given by the Last-Modified
copy should be considered stale. field, that copy should be considered stale.
Last-Modified = "Last-Modified" ":" HTTP-date Last-Modified = "Last-Modified" ":" HTTP-date
An example of its use is An example of its use is
Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT
The exact meaning of this header field depends on the The exact meaning of this header field depends on the
implementation of the sender and the nature of the original implementation of the sender and the nature of the original
resource. For files, it may be just the file system last-modified resource. For files, it may be just the file system last-modified
skipping to change at line 1954 skipping to change at line 2073
parts. For database gateways, it may be the last-update timestamp parts. For database gateways, it may be the last-update timestamp
of the record. For virtual objects, it may be the last time the of the record. For virtual objects, it may be the last time the
internal state changed. internal state changed.
An origin server must not send a Last-Modified date which is later An origin server must not send a Last-Modified date which is later
than the server's time of message origination. In such cases, where than the server's time of message origination. In such cases, where
the resource's last modification would indicate some time in the the resource's last modification would indicate some time in the
future, the server must replace that date with the message future, the server must replace that date with the message
origination date. origination date.
8.11 Location 10.11 Location
The Location response header field defines the exact location of The Location response-header field defines the exact location of
the resource that was identified by the Request-URI. For 3xx the resource that was identified by the Request-URI. For 3xx
responses, the location must indicate the server's preferred URL responses, the location must indicate the server's preferred URL
for automatic redirection to the resource. Only one absolute URL is for automatic redirection to the resource. Only one absolute URL is
allowed. allowed.
Location = "Location" ":" absoluteURI Location = "Location" ":" absoluteURI
An example is An example is
Location: http://www.w3.org/hypertext/WWW/NewLocation.html Location: http://www.w3.org/hypertext/WWW/NewLocation.html
8.12 MIME-Version 10.12 MIME-Version
HTTP is not a MIME-conformant protocol (see Appendix C). However, HTTP is not a MIME-compliant protocol (see Appendix C). However,
HTTP/1.0 messages may include a single MIME-Version header field to HTTP/1.0 messages may include a single MIME-Version general-header
indicate what version of the MIME protocol was used to construct field to indicate what version of the MIME protocol was used to
the message. Use of the MIME-Version header field should indicate construct the message. Use of the MIME-Version header field should
that the message is in full compliance with the MIME protocol (as indicate that the message is in full compliance with the MIME
defined in [5]). Unfortunately, current versions of HTTP/1.0 protocol (as defined in [5]). Unfortunately, some older versions of
clients and servers use this field indiscriminately, and thus HTTP/1.0 clients and servers use this field indiscriminately, and
receivers must not take it for granted that the message is indeed thus recipients must not take it for granted that the message is
in full compliance with MIME. Gateways are responsible for ensuring indeed in full compliance with MIME. Proxies and gateways are
this compliance (where possible) when exporting HTTP messages to responsible for ensuring this compliance (where possible) when
strict MIME environments. Future HTTP/1.0 applications must only exporting HTTP messages to strict MIME environments. Future
use MIME-Version when the message is intended to be MIME-conformant. HTTP/1.0 applications must only use MIME-Version when the message
is fully MIME-compliant.
MIME-Version = "MIME-Version" ":" 1*DIGIT "." 1*DIGIT MIME-Version = "MIME-Version" ":" 1*DIGIT "." 1*DIGIT
MIME version "1.0" is the default for use in HTTP/1.0. However, MIME version "1.0" is the default for use in HTTP/1.0. However,
HTTP/1.0 message parsing and semantics are defined by this document HTTP/1.0 message parsing and semantics are defined by this document
and not the MIME specification. and not the MIME specification.
8.13 Pragma 10.13 Pragma
The Pragma message header field is used to include The Pragma general-header field is used to include
implementation-specific directives that may apply to any recipient implementation-specific directives that may apply to any recipient
along the request/response chain. The directives typically specify along the request/response chain. All pragma directives specify
behavior intended to prevent intermediate proxies or caches from optional behavior from the viewpoint of the protocol; however, some
adversely interfering with the request or response. All pragma systems may require that behavior be consistent with the directives.
directives specify optional behavior from the viewpoint of the
protocol; however, some systems may require that behavior be
consistent with the directives. HTTP/1.0 only defines semantics for
the "no-cache" directive on request messages.
Pragma = "Pragma" ":" 1#pragma-directive Pragma = "Pragma" ":" 1#pragma-directive
pragma-directive = "no-cache" | extension-pragma pragma-directive = "no-cache" | extension-pragma
extension-pragma = token [ "=" word ] extension-pragma = token [ "=" word ]
When the "no-cache" directive is present in a request message, a When the "no-cache" directive is present in a request message, an
caching intermediary should forward the request toward the origin application should forward the request toward the origin server
server even if it has a cached copy of what is being requested. even if it has a cached copy of what is being requested. This
This allows a client to insist upon receiving an authoritative allows a client to insist upon receiving an authoritative response
response to its request. It also allows a client to refresh a to its request. It also allows a client to refresh a cached copy
cached copy which is known to be corrupted or stale. which is known to be corrupted or stale.
Pragma directives must be passed through by a proxy, regardless of Pragma directives must be passed through by a proxy or gateway
their significance to that proxy, since the directives may be application, regardless of their significance to that application,
applicable to all recipients along the request/response chain. It since the directives may be applicable to all recipients along the
is not possible to specify a pragma for a specific recipient; request/response chain. It is not possible to specify a pragma for
however, any pragma directive not relevant to a recipient should be a specific recipient; however, any pragma directive not relevant to
ignored by that recipient. a recipient should be ignored by that recipient.
8.14 Referer 10.14 Referer
The Referer request header field allows the client to specify, for The Referer request-header field allows the client to specify, for
the server's benefit, the address (URI) of the resource from which the server's benefit, the address (URI) of the resource from which
the Request-URI was obtained. This allows a server to generate the Request-URI was obtained. This allows a server to generate
lists of back-links to resources for interest, logging, optimized lists of back-links to resources for interest, logging, optimized
caching, etc. It also allows obsolete or mistyped links to be caching, etc. It also allows obsolete or mistyped links to be
traced for maintenance. The Referer field must not be sent if the traced for maintenance. The Referer field must not be sent if the
Request-URI was obtained from a source that does not have its own Request-URI was obtained from a source that does not have its own
URI, such as input from the user keyboard. URI, such as input from the user keyboard.
Referer = "Referer" ":" ( absoluteURI | relativeURI ) Referer = "Referer" ":" ( absoluteURI | relativeURI )
skipping to change at line 2048 skipping to change at line 2164
Request-URI. The URI must not include a fragment. Request-URI. The URI must not include a fragment.
Note: Because the source of a link may be private Note: Because the source of a link may be private
information or may reveal an otherwise private information information or may reveal an otherwise private information
source, it is strongly recommended that the user be able to source, it is strongly recommended that the user be able to
select whether or not the Referer field is sent. For select whether or not the Referer field is sent. For
example, a browser client could have a toggle switch for example, a browser client could have a toggle switch for
browsing openly/anonymously, which would respectively browsing openly/anonymously, which would respectively
enable/disable the sending of Referer and From information. enable/disable the sending of Referer and From information.
8.15 Server 10.15 Server
The Server response header field contains information about the The Server response-header field contains information about the
software used by the origin server to handle the request. The field software used by the origin server to handle the request. The field
can contain multiple product tokens (Section 3.7) and comments can contain multiple product tokens (Section 3.7) and comments
identifying the server and any significant subproducts. By identifying the server and any significant subproducts. By
convention, the product tokens are listed in order of their convention, the product tokens are listed in order of their
significance for identifying the application. significance for identifying the application.
Server = "Server" ":" 1*( product | comment ) Server = "Server" ":" 1*( product | comment )
Example: Example:
Server: CERN/3.0 libwww/2.17 Server: CERN/3.0 libwww/2.17
If the response is being forwarded through a proxy, the proxy If the response is being forwarded through a proxy, the proxy
application should not add its data to the product list. application must not add its data to the product list.
Note: Revealing the specific software version of the server Note: Revealing the specific software version of the server
may allow the server machine to become more vulnerable to may allow the server machine to become more vulnerable to
attacks against software that is known to contain security attacks against software that is known to contain security
holes. Server implementors are encouraged to make this field holes. Server implementors are encouraged to make this field
a configurable option. a configurable option.
8.16 User-Agent 10.16 User-Agent
The User-Agent field contains information about the user agent The User-Agent request-header field contains information about the
originating the request. This is for statistical purposes, the user agent originating the request. This is for statistical
tracing of protocol violations, and automated recognition of user purposes, the tracing of protocol violations, and automated
agents for the sake of tailoring responses to avoid particular user recognition of user agents for the sake of tailoring responses to
agent limitations. Although it is not required, user agents should avoid particular user agent limitations. Although it is not
always include this field with requests. The field can contain required, user agents should include this field with requests. The
multiple product tokens (Section 3.7) and comments identifying the field can contain multiple product tokens (Section 3.7) and
agent and any subproducts which form a significant part of the user comments identifying the agent and any subproducts which form a
agent. By convention, the product tokens are listed in order of significant part of the user agent. By convention, the product
their significance for identifying the application. tokens are listed in order of their significance for identifying
the application.
User-Agent = "User-Agent" ":" 1*( product | comment ) User-Agent = "User-Agent" ":" 1*( product | comment )
Example: Example:
User-Agent: CERN-LineMode/2.15 libwww/2.17b3 User-Agent: CERN-LineMode/2.15 libwww/2.17b3
The User-Agent field may include additional information within
comments.
Note: Some current proxy applications append their product Note: Some current proxy applications append their product
information to the list in the User-Agent field. This is not information to the list in the User-Agent field. This is not
recommended, since it makes machine interpretation of these recommended, since it makes machine interpretation of these
fields ambiguous. fields ambiguous.
8.17 WWW-Authenticate 10.17 WWW-Authenticate
The WWW-Authenticate header field must be included in 401 The WWW-Authenticate response-header field must be included in 401
(unauthorized) response messages. The field value consists of at (unauthorized) response messages. The field value consists of at
least one challenge that indicates the authentication scheme(s) and least one challenge that indicates the authentication scheme(s) and
parameters applicable to the Request-URI. parameters applicable to the Request-URI.
WWW-Authenticate = "WWW-Authenticate" ":" 1#challenge WWW-Authenticate = "WWW-Authenticate" ":" 1#challenge
The HTTP access authentication process is described in Section 9. The HTTP access authentication process is described in Section 11.
User agents must take special care in parsing the WWW-Authenticate User agents must take special care in parsing the WWW-Authenticate
field value if it contains more than one challenge, or if more than field value if it contains more than one challenge, or if more than
one WWW-Authenticate header field is provided, since the contents one WWW-Authenticate header field is provided, since the contents
of a challenge may itself contain a comma-separated list of of a challenge may itself contain a comma-separated list of
authentication parameters. authentication parameters.
9. Access Authentication 11. Access Authentication
HTTP provides a simple challenge-response authentication mechanism HTTP provides a simple challenge-response authentication mechanism
which may be used by a server to challenge a client request and by which may be used by a server to challenge a client request and by
a client to provide authentication information. It uses an a client to provide authentication information. It uses an
extensible, case-insensitive token to identify the authentication extensible, case-insensitive token to identify the authentication
scheme, followed by a comma-separated list of attribute-value pairs scheme, followed by a comma-separated list of attribute-value pairs
which carry the parameters necessary for achieving authentication which carry the parameters necessary for achieving authentication
via that scheme. via that scheme.
auth-scheme = token auth-scheme = token
skipping to change at line 2173 skipping to change at line 2287
time determined by the authentication scheme, parameters, and/or time determined by the authentication scheme, parameters, and/or
user preference. Unless otherwise defined by the authentication user preference. Unless otherwise defined by the authentication
scheme, a single protection space cannot extend outside the scope scheme, a single protection space cannot extend outside the scope
of its server. of its server.
If the server does not wish to accept the credentials sent with a If the server does not wish to accept the credentials sent with a
request, it should return a 403 (forbidden) response. request, it should return a 403 (forbidden) response.
The HTTP protocol does not restrict applications to this simple The HTTP protocol does not restrict applications to this simple
challenge-response mechanism for access authentication. Additional challenge-response mechanism for access authentication. Additional
mechanisms may be used at the transport level, via message mechanisms may be used, such as encryption at the transport level
encapsulation, and/or with additional header fields specifying or via message encapsulation, and with additional header fields
authentication information. However, these additional mechanisms specifying authentication information. However, these additional
are not defined by this specification. mechanisms are not defined by this specification.
Proxies must be completely transparent regarding user agent Proxies must be completely transparent regarding user agent
authentication. That is, they must forward the WWW-Authenticate and authentication. That is, they must forward the WWW-Authenticate and
Authorization headers untouched, and must not cache the response to Authorization headers untouched, and must not cache the response to
a request containing Authorization. HTTP/1.0 does not provide a a request containing Authorization. HTTP/1.0 does not provide a
means for a client to be authenticated with a proxy. means for a client to be authenticated with a proxy.
9.1 Basic Authentication Scheme 11.1 Basic Authentication Scheme
The "basic" authentication scheme is based on the model that the The "basic" authentication scheme is based on the model that the
user agent must authenticate itself with a user-ID and a password user agent must authenticate itself with a user-ID and a password
for each realm. The realm value should be considered an opaque for each realm. The realm value should be considered an opaque
string which can only be compared for equality with other realms on string which can only be compared for equality with other realms on
that server. The server will authorize the request only if it can that server. The server will authorize the request only if it can
validate the user-ID and password for the protection space of the validate the user-ID and password for the protection space of the
Request-URI. There are no optional authentication parameters. Request-URI. There are no optional authentication parameters.
Upon receipt of an unauthorized request for a URI within the Upon receipt of an unauthorized request for a URI within the
skipping to change at line 2212 skipping to change at line 2326
To receive authorization, the client sends the user-ID and To receive authorization, the client sends the user-ID and
password, separated by a single colon (":") character, within a password, separated by a single colon (":") character, within a
base64 [5] encoded string in the credentials. base64 [5] encoded string in the credentials.
basic-credentials = "Basic" SP basic-cookie basic-credentials = "Basic" SP basic-cookie
basic-cookie = <base64 [5] encoding of userid-password, basic-cookie = <base64 [5] encoding of userid-password,
except not limited to 76 char/line> except not limited to 76 char/line>
userid-password = [ token ] ":" *text userid-password = [ token ] ":" *TEXT
If the user agent wishes to send the user-ID "Aladdin" and password If the user agent wishes to send the user-ID "Aladdin" and password
"open sesame", it would use the following header field: "open sesame", it would use the following header field:
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
The basic authentication scheme is a non-secure method of filtering The basic authentication scheme is a non-secure method of filtering
unauthorized access to resources on an HTTP server. It is based on unauthorized access to resources on an HTTP server. It is based on
the assumption that the connection between the client and the the assumption that the connection between the client and the
server can be regarded as a trusted carrier. As this is not server can be regarded as a trusted carrier. As this is not
generally true on an open network, the basic authentication scheme generally true on an open network, the basic authentication scheme
should be used accordingly. In spite of this, clients are should be used accordingly. In spite of this, clients should
encouraged to implement the scheme in order to communicate with implement the scheme in order to communicate with servers that use
servers that use it. it.
10. Security Considerations 12. Security Considerations
This section is meant to inform application developers, information This section is meant to inform application developers, information
providers, and users of the security limitations in HTTP/1.0 as providers, and users of the security limitations in HTTP/1.0 as
described by this document. The discussion does not include described by this document. The discussion does not include
definitive solutions to the problems revealed, though it does make definitive solutions to the problems revealed, though it does make
some suggestions for reducing security risks. some suggestions for reducing security risks.
10.1 Authentication of Clients 12.1 Authentication of Clients
As mentioned in Section 9.1, the Basic authentication scheme is not As mentioned in Section 11.1, the Basic authentication scheme is
a secure method of user authentication, nor does it prevent the not a secure method of user authentication, nor does it prevent the
Entity-Body from being transmitted in clear text across the Entity-Body from being transmitted in clear text across the
physical network used as the carrier. HTTP/1.0 does not prevent physical network used as the carrier. HTTP/1.0 does not prevent
additional authentication schemes and encryption mechanisms from additional authentication schemes and encryption mechanisms from
being employed to increase security. being employed to increase security.
10.2 Safe Methods 12.2 Safe Methods
The writers of client software should be aware that the software The writers of client software should be aware that the software
represents the user in their interactions over the Internet, and represents the user in their interactions over the Internet, and
should be careful to allow the user to be aware of any actions they should be careful to allow the user to be aware of any actions they
may take which may have an unexpected significance to themselves or may take which may have an unexpected significance to themselves or
others. others.
In particular, the convention has been established that the GET and In particular, the convention has been established that the GET and
HEAD methods should never have the significance of taking an action HEAD methods should never have the significance of taking an action
other than retrieval. These methods should be considered "safe." other than retrieval. These methods should be considered "safe."
This allows user agents to represent other methods, such as POST, This allows user agents to represent other methods, such as POST,
in a special way, so that the user is made aware of the fact that a in a special way, so that the user is made aware of the fact that a
possibly unsafe action is being requested. possibly unsafe action is being requested.
Naturally, it is not possible to ensure that the server does not Naturally, it is not possible to ensure that the server does not
generate side-effects as a result of performing a GET request; in generate side-effects as a result of performing a GET request; in
fact, some dynamic resources consider that a feature. The important fact, some dynamic resources consider that a feature. The important
distinction here is that the user did not request the side-effects, distinction here is that the user did not request the side-effects,
so therefore cannot be held accountable for them. so therefore cannot be held accountable for them.
10.3 Abuse of Server Log Information 12.3 Abuse of Server Log Information
A server is in the position to save personal data about a user's A server is in the position to save personal data about a user's
requests which may identify their reading patterns or subjects of requests which may identify their reading patterns or subjects of
interest. This information is clearly confidential in nature and interest. This information is clearly confidential in nature and
its handling may be constrained by law in certain countries. People its handling may be constrained by law in certain countries. People
using the HTTP protocol to provide data are responsible for using the HTTP protocol to provide data are responsible for
ensuring that such material is not distributed without the ensuring that such material is not distributed without the
permission of any individuals that are identifiable by the permission of any individuals that are identifiable by the
published results. published results.
10.4 Transfer of Sensitive Information 12.4 Transfer of Sensitive Information
Like any generic data transfer protocol, HTTP cannot regulate the Like any generic data transfer protocol, HTTP cannot regulate the
content of the data that is transferred, nor is there any a priori content of the data that is transferred, nor is there any a priori
method of determining the sensitivity of any particular piece of method of determining the sensitivity of any particular piece of
information within the context of any given request. Therefore, information within the context of any given request. Therefore,
applications are encouraged to supply as much control over this applications should supply as much control over this information as
information as possible to the provider of that information. Three possible to the provider of that information. Three header fields
header fields are worth special mention in this context: Server, are worth special mention in this context: Server, Referer and From.
Referer and From.
Revealing the specific software version of the server may allow the Revealing the specific software version of the server may allow the
server machine to become more vulnerable to attacks against server machine to become more vulnerable to attacks against
software that is known to contain security holes. Implementors are software that is known to contain security holes. Implementors
encouraged to make the Server header field a configurable option. should make the Server header field a configurable option.
The Referer field allows reading patterns to be studied and reverse The Referer field allows reading patterns to be studied and reverse
links drawn. Although it can be very useful, its power can be links drawn. Although it can be very useful, its power can be
abused if user details are not separated from the information abused if user details are not separated from the information
contained in the Referer. Even when the personal information has contained in the Referer. Even when the personal information has
been removed, the Referer field may indicate a private document's been removed, the Referer field may indicate a private document's
URI whose publication would be inappropriate. URI whose publication would be inappropriate.
The information sent in the From field might conflict with the The information sent in the From field might conflict with the
user's privacy interests or their site's security policy, and hence user's privacy interests or their site's security policy, and hence
it should not be transmitted without the user being able to it should not be transmitted without the user being able to
disable, enable, and modify the contents of the field. The user disable, enable, and modify the contents of the field. The user
must be able to set the contents of this field within a user must be able to set the contents of this field within a user
preference or application defaults configuration. preference or application defaults configuration.
We suggest, though do not require, that a convenient toggle We suggest, though do not require, that a convenient toggle
interface be provided for the user to enable or disable the sending interface be provided for the user to enable or disable the sending
of From and Referer information. of From and Referer information.
11. Acknowledgments 13. Acknowledgments
This specification makes heavy use of the augmented BNF and generic This specification makes heavy use of the augmented BNF and generic
constructs defined by David H. Crocker for RFC 822 [7]. Similarly, constructs defined by David H. Crocker for RFC 822 [7]. Similarly,
it reuses many of the definitions provided by Nathaniel Borenstein it reuses many of the definitions provided by Nathaniel Borenstein
and Ned Freed for MIME [5]. We hope that their inclusion in this and Ned Freed for MIME [5]. We hope that their inclusion in this
specification will help reduce past confusion over the relationship specification will help reduce past confusion over the relationship
between HTTP/1.0 and Internet mail message formats. between HTTP/1.0 and Internet mail message formats.
The HTTP protocol has evolved considerably over the past three The HTTP protocol has evolved considerably over the past four
years. It has benefited from a large and active developer years. It has benefited from a large and active developer
community--the many people who have participated on the www-talk community--the many people who have participated on the www-talk
mailing list--and it is that community which has been most mailing list--and it is that community which has been most
responsible for the success of HTTP and of the World-Wide Web in responsible for the success of HTTP and of the World-Wide Web in
general. Marc Andreessen, Robert Cailliau, Daniel W. Connolly, general. Marc Andreessen, Robert Cailliau, Daniel W. Connolly,
Bob Denny, Jean Francois-Groff, Phillip M. Hallam-Baker, Bob Denny, Jean-Francois Groff, Phillip M. Hallam-Baker,
Hakon W. Lie, Ari Luotonen, Rob McCool, Lou Montulli, Dave Raggett, Hakon W. Lie, Ari Luotonen, Rob McCool, Lou Montulli, Dave Raggett,
Tony Sanders, and Marc VanHeyningen deserve special recognition for Tony Sanders, and Marc VanHeyningen deserve special recognition for
their efforts in defining aspects of the protocol for early versions their efforts in defining aspects of the protocol for early versions
of this specification. of this specification.
This document has benefited greatly from the comments of all those This document has benefited greatly from the comments of all those
participating in the HTTP-WG. In addition to those already participating in the HTTP-WG. In addition to those already
mentioned, the following individuals have contributed to this mentioned, the following individuals have contributed to this
specification: specification:
skipping to change at line 2356 skipping to change at line 2469
Daniel LaLiberte Paul Leach Daniel LaLiberte Paul Leach
Albert Lunde John C. Mallery Albert Lunde John C. Mallery
Larry Masinter Mitra Larry Masinter Mitra
Gavin Nicol Bill Perry Gavin Nicol Bill Perry
Jeffrey Perry Owen Rees Jeffrey Perry Owen Rees
David Robinson Marc Salomon David Robinson Marc Salomon
Rich Salz Jim Seidman Rich Salz Jim Seidman
Chuck Shotton Eric W. Sink Chuck Shotton Eric W. Sink
Simon E. Spero Robert S. Thau Simon E. Spero Robert S. Thau
Francois Yergeau Mary Ellen Zurko Francois Yergeau Mary Ellen Zurko
Jean-Philippe Martin-Flatin
12. References 14. References
[1] F. Anklesaria, M. McCahill, P. Lindner, D. Johnson, D. Torrey, [1] F. Anklesaria, M. McCahill, P. Lindner, D. Johnson, D. Torrey,
and B. Alberti. "The Internet Gopher Protocol: A distributed and B. Alberti. "The Internet Gopher Protocol: A distributed
document search and retrieval protocol." RFC 1436, University document search and retrieval protocol." RFC 1436, University
of Minnesota, March 1993. of Minnesota, March 1993.
[2] T. Berners-Lee. "Universal Resource Identifiers in WWW: [2] T. Berners-Lee. "Universal Resource Identifiers in WWW: A
A Unifying Syntax for the Expression of Names and Addresses of Unifying Syntax for the Expression of Names and Addresses of
Objects on the Network as used in the World-Wide Web." Objects on the Network as used in the World-Wide Web." RFC
RFC 1630, CERN, June 1994. 1630, CERN, June 1994.
[3] T. Berners-Lee and D. Connolly. "HyperText Markup Language [3] T. Berners-Lee and D. Connolly. "HyperText Markup Language
Specification - 2.0." Work in Progress Specification - 2.0." Work in Progress
(draft-ietf-html-spec-05.txt), MIT/W3C, August 1995. (draft-ietf-html-spec-05.txt), MIT/W3C, August 1995.
[4] T. Berners-Lee, L. Masinter, and M. McCahill. "Uniform Resource [4] T. Berners-Lee, L. Masinter, and M. McCahill. "Uniform Resource
Locators (URL)." RFC 1738, CERN, Xerox PARC, University of Locators (URL)." RFC 1738, CERN, Xerox PARC, University of
Minnesota, December 1994. Minnesota, December 1994.
[5] N. Borenstein and N. Freed. "MIME (Multipurpose Internet Mail [5] N. Borenstein and N. Freed. "MIME (Multipurpose Internet Mail
skipping to change at line 2426 skipping to change at line 2540
[16] K. Sollins and L. Masinter. "Functional Requirements for [16] K. Sollins and L. Masinter. "Functional Requirements for
Uniform Resource Names." RFC 1737, MIT/LCS, Xerox Corporation, Uniform Resource Names." RFC 1737, MIT/LCS, Xerox Corporation,
December 1994. December 1994.
[17] US-ASCII. Coded Character Set - 7-Bit American Standard Code [17] US-ASCII. Coded Character Set - 7-Bit American Standard Code
for Information Interchange. Standard ANSI X3.4-1986, ANSI, for Information Interchange. Standard ANSI X3.4-1986, ANSI,
1986. 1986.
[18] ISO-8859. International Standard -- Information Processing -- [18] ISO-8859. International Standard -- Information Processing --
8-bit Single-Byte Coded Graphic Character Sets -- 8-bit Single-Byte Coded Graphic Character Sets --
Part 1: Latin Alphabet No. 1, ISO 8859-1:1987. Part 1: Latin alphabet No. 1, ISO 8859-1:1987.
Part 2: Latin alphabet No. 2, ISO 8859-2, 1987. Part 2: Latin alphabet No. 2, ISO 8859-2, 1987.
Part 3: Latin alphabet No. 3, ISO 8859-3, 1988. Part 3: Latin alphabet No. 3, ISO 8859-3, 1988.
Part 4: Latin alphabet No. 4, ISO 8859-4, 1988. Part 4: Latin alphabet No. 4, ISO 8859-4, 1988.
Part 5: Latin/Cyrillic alphabet, ISO 8859-5, 1988. Part 5: Latin/Cyrillic alphabet, ISO 8859-5, 1988.
Part 6: Latin/Arabic alphabet, ISO 8859-6, 1987. Part 6: Latin/Arabic alphabet, ISO 8859-6, 1987.
Part 7: Latin/Greek alphabet, ISO 8859-7, 1987. Part 7: Latin/Greek alphabet, ISO 8859-7, 1987.
Part 8: Latin/Hebrew alphabet, ISO 8859-8, 1988. Part 8: Latin/Hebrew alphabet, ISO 8859-8, 1988.
Part 9: Latin alphabet No. 5, ISO 8859-9, 1990. Part 9: Latin alphabet No. 5, ISO 8859-9, 1990.
13. Authors' Addresses 15. Authors' Addresses
Tim Berners-Lee Tim Berners-Lee
Director, W3 Consortium Director, W3 Consortium
MIT Laboratory for Computer Science MIT Laboratory for Computer Science
545 Technology Square 545 Technology Square
Cambridge, MA 02139, U.S.A. Cambridge, MA 02139, U.S.A.
Tel: +1 (617) 253 5702 Tel: +1 (617) 253 5702
Fax: +1 (617) 258 8682 Fax: +1 (617) 258 8682
Email: timbl@w3.org Email: timbl@w3.org
skipping to change at line 2504 skipping to change at line 2618
Security considerations: none Security considerations: none
B. Tolerant Applications B. Tolerant Applications
Although this document specifies the requirements for the Although this document specifies the requirements for the
generation of HTTP/1.0 messages, not all applications will be generation of HTTP/1.0 messages, not all applications will be
correct in their implementation. We therefore recommend that correct in their implementation. We therefore recommend that
operational applications be tolerant of deviations whenever those operational applications be tolerant of deviations whenever those
deviations can be interpreted unambiguously. deviations can be interpreted unambiguously.
Clients should be tolerant in parsing the StatusLine and servers Clients should be tolerant in parsing the Status-Line and servers
tolerant when parsing the RequestLine. In particular, they should tolerant when parsing the Request-Line. In particular, they should
accept any amount of SP or HT characters between fields, even accept any amount of SP or HT characters between fields, even
though only a single SP is required. though only a single SP is required.
The line terminator for HTTP-header fields is the sequence CRLF. The line terminator for HTTP-header fields is the sequence CRLF.
However, we recommend that applications, when parsing such headers, However, we recommend that applications, when parsing such headers,
recognize a single LF as a line terminator and ignore the leading CR. recognize a single LF as a line terminator and ignore the leading
CR.
C. Relationship to MIME C. Relationship to MIME
HTTP/1.0 reuses many of the constructs defined for Internet Mail HTTP/1.0 reuses many of the constructs defined for Internet Mail
(RFC 822 [7]) and the Multipurpose Internet Mail Extensions (RFC 822 [7]) and the Multipurpose Internet Mail Extensions
(MIME [5]) to allow entities to be transmitted in an open variety (MIME [5]) to allow entities to be transmitted in an open variety
of representations and with extensible mechanisms. However, HTTP is of representations and with extensible mechanisms. However, HTTP is
not a MIME-conforming application. HTTP's performance requirements not a MIME-compliant application. HTTP's performance requirements
differ substantially from those of Internet mail. Since it is not differ substantially from those of Internet mail. Since it is not
limited by the restrictions of existing mail protocols and limited by the restrictions of existing mail protocols and SMTP
gateways, HTTP does not obey some of the constraints imposed by gateways, HTTP does not obey some of the constraints imposed by
RFC 822 and MIME for mail transport. RFC 822 and MIME for mail transport.
This appendix describes specific areas where HTTP differs from This appendix describes specific areas where HTTP differs from
MIME. Gateways to MIME-compliant protocols must be aware of these MIME. Proxies/gateways to MIME-compliant protocols must be aware of
differences and provide the appropriate conversions where necessary. these differences and provide the appropriate conversions where
necessary.
C.1 Conversion to Canonical Form C.1 Conversion to Canonical Form
MIME requires that an entity be converted to canonical form prior MIME requires that an entity be converted to canonical form prior
to being transferred, as described in Appendix G of RFC 1521 [5]. to being transferred, as described in Appendix G of RFC 1521 [5].
Although HTTP does require media types to be transferred in Although HTTP does require media types to be transferred in
canonical form, it changes the definition of "canonical form" for canonical form, it changes the definition of "canonical form" for
text-based media types as described in Section 3.6.1. text-based media types as described in Section 3.6.1.
C.1.1 Representation of Line Breaks C.1.1 Representation of Line Breaks
MIME requires that the canonical form of any text type represent MIME requires that the canonical form of any text type represent
line breaks as CRLF and forbids the use of CR or LF outside of line line breaks as CRLF and forbids the use of CR or LF outside of line
break sequences. Since HTTP allows CRLF, bare CR, and bare LF (or break sequences. Since HTTP allows CRLF, bare CR, and bare LF (or
the octet sequence(s) to which they would be translated for the the octet sequence(s) to which they would be translated for the
given character set) to indicate a line break within text content, given character set) to indicate a line break within text content,
recipients of an HTTP message cannot rely upon receiving recipients of an HTTP message cannot rely upon receiving
MIME-canonical line breaks in text. MIME-canonical line breaks in text.
Where it is possible, a gateway from HTTP to a MIME-conformant Where it is possible, a proxy or gateway from HTTP to a
protocol should translate all line breaks within text/* media types MIME-compliant protocol should translate all line breaks within
to the MIME canonical form of CRLF. However, this may be text/* media types to the MIME canonical form of CRLF. However,
complicated by the presence of a Content-Encoding and by the fact this may be complicated by the presence of a Content-Encoding and
that HTTP allows the use of some character sets which do not use by the fact that HTTP allows the use of some character sets which
octets 13 and 10 to represent CR and LF, as is the case for some do not use octets 13 and 10 to represent CR and LF, as is the case
multi-byte character sets. If canonicalization is performed, the for some multi-byte character sets. If canonicalization is
Content-Length header field value must be updated to reflect the performed, the Content-Length header field value must be updated to
new body length. reflect the new body length.
C.1.2 Default Character Set C.1.2 Default Character Set
MIME requires that all subtypes of the top-level Content-Type MIME requires that all subtypes of the top-level Content-Type
"text" have a default character set of US-ASCII [17]. In contrast, "text" have a default character set of US-ASCII [17]. In contrast,
HTTP defines the default character set for "text" to be HTTP defines the default character set for "text" to be
ISO-8859-1 [18] (a superset of US-ASCII). Therefore, if a text/* ISO-8859-1 [18] (a superset of US-ASCII). Therefore, if a text/*
media type given in the Content-Type header field does not already media type given in the Content-Type header field does not already
include an explicit charset parameter, the parameter include an explicit charset parameter, the parameter
;charset="iso-8859-1" ;charset="iso-8859-1"
should be added by the gateway if the entity contains any octets should be added by the proxy/gateway if the entity contains any
greater than 127. octets greater than 127.
C.2 Conversion of Date Formats C.2 Conversion of Date Formats
HTTP/1.0 uses a restricted subset of date formats to simplify the HTTP/1.0 uses a restricted subset of date formats to simplify the
process of date comparison. Gateways from other protocols should process of date comparison. Proxies/gateways from other protocols
ensure that any Date header field present in a message conforms to should ensure that any Date header field present in a message
one of the HTTP/1.0 formats and rewrite the date if necessary. conforms to one of the HTTP/1.0 formats and rewrite the date if
necessary.
C.3 Introduction of Content-Encoding C.3 Introduction of Content-Encoding
MIME does not include any concept equivalent to HTTP's MIME does not include any concept equivalent to HTTP's
Content-Encoding header field. Since this acts as a modifier on the Content-Encoding header field. Since this acts as a modifier on the
media type, gateways to MIME-conformant protocols must either media type, proxies/gateways to MIME-compliant protocols must
change the value of the Content-Type header field or decode the either change the value of the Content-Type header field or decode
Entity-Body before forwarding the message. the Entity-Body before forwarding the message.
Note: Some experimental applications of Content-Type for Note: Some experimental applications of Content-Type for
Internet mail have used a media-type parameter of Internet mail have used a media-type parameter of
";conversions=<content-coding>" to perform an equivalent ";conversions=<content-coding>" to perform an equivalent
function as Content-Encoding. However, this parameter is not function as Content-Encoding. However, this parameter is not
part of the MIME specification at the time of this writing. part of the MIME specification at the time of this writing.
C.4 No Content-Transfer-Encoding C.4 No Content-Transfer-Encoding
HTTP does not use the Content-Transfer-Encoding (CTE) field of HTTP does not use the Content-Transfer-Encoding (CTE) field of
MIME. Gateways from MIME-compliant protocols must remove any MIME. Proxies/gateways from MIME-compliant protocols must remove
non-identity CTE ("quoted-printable" or "base64") encoding prior to any non-identity CTE ("quoted-printable" or "base64") encoding
delivering the response message to an HTTP client. Gateways to prior to delivering the response message to an HTTP client.
MIME-compliant protocols are responsible for ensuring that the Proxies/gateways to MIME-compliant protocols are responsible for
message is in the correct format and encoding for safe transport on ensuring that the message is in the correct format and encoding for
that protocol, where "safe transport" is defined by the limitations safe transport on that protocol, where "safe transport" is defined
of the protocol being used. At a minimum, the CTE field of by the limitations of the protocol being used. At a minimum, the
CTE field of
Content-Transfer-Encoding: binary Content-Transfer-Encoding: binary
should be added by the gateway if it is unwilling to apply a should be added by the proxy/gateway if it is unwilling to apply a
content transfer encoding. content transfer encoding.
An HTTP client may include a Content-Transfer-Encoding as an An HTTP client may include a Content-Transfer-Encoding as an
extension Entity-Header in a POST request when it knows the extension Entity-Header in a POST request when it knows the
destination of that request is a gateway to a MIME-compliant destination of that request is a proxy/gateway to a MIME-compliant
protocol. protocol.
 End of changes. 180 change blocks. 
711 lines changed or deleted 829 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/