Changeset 1839
- Timestamp:
- 25/08/12 09:08:32 (10 years ago)
- Location:
- draft-ietf-httpbis/latest
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
draft-ietf-httpbis/latest/p1-messaging.html
r1838 r1839 449 449 } 450 450 @bottom-center { 451 content: "Expires February 2 1, 2013";451 content: "Expires February 25, 2013"; 452 452 } 453 453 @bottom-right { … … 492 492 <meta name="dct.creator" content="Reschke, J. F."> 493 493 <meta name="dct.identifier" content="urn:ietf:id:draft-ietf-httpbis-p1-messaging-latest"> 494 <meta name="dct.issued" scheme="ISO8601" content="2012-08-2 0">494 <meta name="dct.issued" scheme="ISO8601" content="2012-08-24"> 495 495 <meta name="dct.replaces" content="urn:ietf:rfc:2145"> 496 496 <meta name="dct.replaces" content="urn:ietf:rfc:2616"> … … 524 524 </tr> 525 525 <tr> 526 <td class="left">Expires: February 2 1, 2013</td>526 <td class="left">Expires: February 25, 2013</td> 527 527 <td class="right">greenbytes</td> 528 528 </tr> 529 529 <tr> 530 530 <td class="left"></td> 531 <td class="right">August 2 0, 2012</td>531 <td class="right">August 24, 2012</td> 532 532 </tr> 533 533 </tbody> … … 556 556 in progress”. 557 557 </p> 558 <p>This Internet-Draft will expire on February 2 1, 2013.</p>558 <p>This Internet-Draft will expire on February 25, 2013.</p> 559 559 <h1><a id="rfc.copyrightnotice" href="#rfc.copyrightnotice">Copyright Notice</a></h1> 560 560 <p>Copyright © 2012 IETF Trust and the persons identified as the document authors. All rights reserved.</p> … … 584 584 <li><a href="#rfc.section.2.3">2.3</a> <a href="#intermediaries">Intermediaries</a></li> 585 585 <li><a href="#rfc.section.2.4">2.4</a> <a href="#caches">Caches</a></li> 586 <li><a href="#rfc.section.2.5">2.5</a> <a href="# intro.conformance.and.error.handling">Conformance and Error Handling</a></li>586 <li><a href="#rfc.section.2.5">2.5</a> <a href="#conformance">Conformance and Error Handling</a></li> 587 587 <li><a href="#rfc.section.2.6">2.6</a> <a href="#http.version">Protocol Versioning</a></li> 588 588 <li><a href="#rfc.section.2.7">2.7</a> <a href="#uri">Uniform Resource Identifiers</a><ul> … … 776 776 in this document are to be interpreted as described in <a href="#RFC2119" id="rfc.xref.RFC2119.1"><cite title="Key words for use in RFCs to Indicate Requirement Levels">[RFC2119]</cite></a>. 777 777 </p> 778 <p id="rfc.section.1.1.p.2">Conformance criteria and considerations regarding error handling are defined in <a href="#conformance" title="Conformance and Error Handling">Section 2.5</a>. 779 </p> 778 780 <div id="rfc.iref.g.1"></div> 779 781 <div id="rfc.iref.g.2"></div> … … 906 908 or an intranet-to-Internet privacy filter. Such transformations are presumed to be desired by the client (or client organization) 907 909 that selected the proxy and are beyond the scope of this specification. However, when a proxy is not intended to transform 908 a given message, we use the term "<dfn>non-transforming proxy</dfn>" to target requirements that preserve HTTP message semantics. See <a href="p2-semantics.html#status.203" title="203 Non-Authoritative Information">Section 4.4.4</a> of <a href="#Part2" id="rfc.xref.Part2.3"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a> and <a href="p6-cache.html#header.warning" title="Warning">Section 7.6</a> of <a href="#Part6" id="rfc.xref.Part6.2"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a> for status and warning codes related to transformations.910 a given message, we use the term "<dfn>non-transforming proxy</dfn>" to target requirements that preserve HTTP message semantics. See <a href="p2-semantics.html#status.203" title="203 Non-Authoritative Information">Section 5.4.4</a> of <a href="#Part2" id="rfc.xref.Part2.3"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a> and <a href="p6-cache.html#header.warning" title="Warning">Section 7.6</a> of <a href="#Part6" id="rfc.xref.Part6.2"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a> for status and warning codes related to transformations. 909 911 </p> 910 912 <p id="rfc.section.2.3.p.7"><span id="rfc.iref.g.13"></span><span id="rfc.iref.r.4"></span> <span id="rfc.iref.a.1"></span> A "<dfn>gateway</dfn>" (a.k.a., "<dfn>reverse proxy</dfn>") is a receiving agent that acts as a layer above some other server(s) and translates the received requests to the underlying … … 957 959 on. 958 960 </p> 959 <h2 id="rfc.section.2.5"><a href="#rfc.section.2.5">2.5</a> <a id=" intro.conformance.and.error.handling" href="#intro.conformance.and.error.handling">Conformance and Error Handling</a></h2>961 <h2 id="rfc.section.2.5"><a href="#rfc.section.2.5">2.5</a> <a id="conformance" href="#conformance">Conformance and Error Handling</a></h2> 960 962 <p id="rfc.section.2.5.p.1">This specification targets conformance criteria according to the role of a participant in HTTP communication. Hence, HTTP 961 963 requirements are placed on senders, recipients, clients, servers, user agents, intermediaries, origin servers, proxies, gateways, … … 1076 1078 </p> 1077 1079 <p id="rfc.section.2.7.1.p.6">When an "http" URI is used within a context that calls for access to the indicated resource, a client <em class="bcp14">MAY</em> attempt access by resolving the host to an IP address, establishing a TCP connection to that address on the indicated port, 1078 and sending an HTTP request message (<a href="#http.message" title="Message Format">Section 3</a>) containing the URI's identifying data (<a href="#message.routing" title="Message Routing">Section 5</a>) to the server. If the server responds to that request with a non-interim HTTP response message, as described in <a href="p2-semantics.html#status.codes" title=" Status Codes">Section 4</a> of <a href="#Part2" id="rfc.xref.Part2.4"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>, then that response is considered an authoritative answer to the client's request.1080 and sending an HTTP request message (<a href="#http.message" title="Message Format">Section 3</a>) containing the URI's identifying data (<a href="#message.routing" title="Message Routing">Section 5</a>) to the server. If the server responds to that request with a non-interim HTTP response message, as described in <a href="p2-semantics.html#status.codes" title="Response Status Codes">Section 5</a> of <a href="#Part2" id="rfc.xref.Part2.4"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>, then that response is considered an authoritative answer to the client's request. 1079 1081 </p> 1080 1082 <p id="rfc.section.2.7.1.p.7">Although HTTP is independent of the transport protocol, the "http" scheme is specific to TCP-based services because the name … … 1174 1176 </div> 1175 1177 <div id="rfc.figure.u.14"></div><pre class="inline"><span id="rfc.iref.g.29"></span> <a href="#method" class="smpl">method</a> = <a href="#rule.token.separators" class="smpl">token</a> 1176 </pre><p id="rfc.section.3.1.1.p.6">The methods defined by this specification can be found in <a href="p2-semantics.html#methods" title=" Methods">Section 2</a> of <a href="#Part2" id="rfc.xref.Part2.5"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>, along with information regarding the HTTP method registry and considerations for defining new methods.1178 </pre><p id="rfc.section.3.1.1.p.6">The methods defined by this specification can be found in <a href="p2-semantics.html#methods" title="Request Methods">Section 3</a> of <a href="#Part2" id="rfc.xref.Part2.5"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>, along with information regarding the HTTP method registry and considerations for defining new methods. 1177 1179 </p> 1178 1180 <div id="rfc.iref.r.6"></div> … … 1187 1189 </p> 1188 1190 <p id="rfc.section.3.1.1.p.10">HTTP does not place a pre-defined limit on the length of a request-line. A server that receives a method longer than any that 1189 it implements <em class="bcp14">SHOULD</em> respond with either a <a href="p2-semantics.html#status.405" class="smpl">405 (Method Not Allowed)</a>, if it is an origin server, or a <a href="p2-semantics.html#status.501" class="smpl">501 (Not Implemented)</a> status code. A server <em class="bcp14">MUST</em> be prepared to receive URIs of unbounded length and respond with the <a href="p2-semantics.html#status.414" class="smpl">414 (URI Too Long)</a> status code if the received request-target would be longer than the server wishes to handle (see <a href="p2-semantics.html#status.414" title="414 URI Too Long">Section 4.6.12</a> of <a href="#Part2" id="rfc.xref.Part2.6"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>).1191 it implements <em class="bcp14">SHOULD</em> respond with either a <a href="p2-semantics.html#status.405" class="smpl">405 (Method Not Allowed)</a>, if it is an origin server, or a <a href="p2-semantics.html#status.501" class="smpl">501 (Not Implemented)</a> status code. A server <em class="bcp14">MUST</em> be prepared to receive URIs of unbounded length and respond with the <a href="p2-semantics.html#status.414" class="smpl">414 (URI Too Long)</a> status code if the received request-target would be longer than the server wishes to handle (see <a href="p2-semantics.html#status.414" title="414 URI Too Long">Section 5.6.12</a> of <a href="#Part2" id="rfc.xref.Part2.6"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>). 1190 1192 </p> 1191 1193 <p id="rfc.section.3.1.1.p.11">Various ad-hoc limitations on request-line length are found in practice. It is <em class="bcp14">RECOMMENDED</em> that all HTTP senders and recipients support, at a minimum, request-line lengths of up to 8000 octets. … … 1200 1202 <p id="rfc.section.3.1.2.p.4">The status-code element is a 3-digit integer code describing the result of the server's attempt to understand and satisfy 1201 1203 the client's corresponding request. The rest of the response message is to be interpreted in light of the semantics defined 1202 for that status code. See <a href="p2-semantics.html#status.codes" title=" Status Codes">Section 4</a> of <a href="#Part2" id="rfc.xref.Part2.7"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a> for information about the semantics of status codes, including the classes of status code (indicated by the first digit),1204 for that status code. See <a href="p2-semantics.html#status.codes" title="Response Status Codes">Section 5</a> of <a href="#Part2" id="rfc.xref.Part2.7"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a> for information about the semantics of status codes, including the classes of status code (indicated by the first digit), 1203 1205 the status codes defined by this specification, considerations for the definition of new status codes, and the IANA registry. 1204 1206 </p> … … 1221 1223 ; see <a href="#field.parsing" title="Field Parsing">Section 3.2.2</a> 1222 1224 </pre><p id="rfc.section.3.2.p.3">The field-name token labels the corresponding field-value as having the semantics defined by that header field. For example, 1223 the <a href="p2-semantics.html#header.date" class="smpl">Date</a> header field is defined in <a href="p2-semantics.html#header.date" title="Date">Section 9.10</a> of <a href="#Part2" id="rfc.xref.Part2.8"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a> as containing the origination timestamp for the message in which it appears.1225 the <a href="p2-semantics.html#header.date" class="smpl">Date</a> header field is defined in <a href="p2-semantics.html#header.date" title="Date">Section 10.10</a> of <a href="#Part2" id="rfc.xref.Part2.8"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a> as containing the origination timestamp for the message in which it appears. 1224 1226 </p> 1225 1227 <p id="rfc.section.3.2.p.4">HTTP header fields are fully extensible: there is no limit on the introduction of new field names, each presumably defining … … 1229 1231 them. 1230 1232 </p> 1231 <p id="rfc.section.3.2.p.5">New HTTP header fields <em class="bcp14">SHOULD</em> be registered with IANA according to the procedures in <a href="p2-semantics.html#considerations.for.creating.header.fields" title="Considerations for Creating Header Fields">Section 3.1</a> of <a href="#Part2" id="rfc.xref.Part2.9"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>. Unrecognized header fields <em class="bcp14">MUST</em> be forwarded by a proxy unless the field-name is listed in the <a href="#header.connection" class="smpl">Connection</a> header field (<a href="#header.connection" id="rfc.xref.header.connection.3" title="Connection">Section 6.1</a>) or the proxy is specifically configured to block or otherwise transform such fields. Unrecognized header fields <em class="bcp14">SHOULD</em> be ignored by other recipients.1233 <p id="rfc.section.3.2.p.5">New HTTP header fields <em class="bcp14">SHOULD</em> be registered with IANA according to the procedures in <a href="p2-semantics.html#considerations.for.creating.header.fields" title="Considerations for Creating Header Fields">Section 4.5</a> of <a href="#Part2" id="rfc.xref.Part2.9"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>. Unrecognized header fields <em class="bcp14">MUST</em> be forwarded by a proxy unless the field-name is listed in the <a href="#header.connection" class="smpl">Connection</a> header field (<a href="#header.connection" id="rfc.xref.header.connection.3" title="Connection">Section 6.1</a>) or the proxy is specifically configured to block or otherwise transform such fields. Unrecognized header fields <em class="bcp14">SHOULD</em> be ignored by other recipients. 1232 1234 </p> 1233 1235 <p id="rfc.section.3.2.p.6">The order in which header fields with differing field names are received is not significant. However, it is "good practice" … … 1381 1383 <p id="rfc.section.3.3.1.p.6">If more than one Transfer-Encoding header field is present in a message, the multiple field-values <em class="bcp14">MUST</em> be combined into one field-value, according to the algorithm defined in <a href="#header.fields" title="Header Fields">Section 3.2</a>, before determining the message body length. 1382 1384 </p> 1383 <p id="rfc.section.3.3.1.p.7">Unlike <a href="p2-semantics.html#header.content-encoding" class="smpl">Content-Encoding</a> (<a href="p2-semantics.html#content.codings" title="Content Codings">Section 5.4</a> of <a href="#Part2" id="rfc.xref.Part2.10"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>), Transfer-Encoding is a property of the message, not of the payload, and thus <em class="bcp14">MAY</em> be added or removed by any implementation along the request/response chain. Additional information about the encoding parameters <em class="bcp14">MAY</em> be provided by other header fields not defined by this specification.1385 <p id="rfc.section.3.3.1.p.7">Unlike <a href="p2-semantics.html#header.content-encoding" class="smpl">Content-Encoding</a> (<a href="p2-semantics.html#content.codings" title="Content Codings">Section 6.4</a> of <a href="#Part2" id="rfc.xref.Part2.10"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>), Transfer-Encoding is a property of the message, not of the payload, and thus <em class="bcp14">MAY</em> be added or removed by any implementation along the request/response chain. Additional information about the encoding parameters <em class="bcp14">MAY</em> be provided by other header fields not defined by this specification. 1384 1386 </p> 1385 1387 <p id="rfc.section.3.3.1.p.8">Transfer-Encoding <em class="bcp14">MAY</em> be sent in a response to a HEAD request or in a <a href="p4-conditional.html#status.304" class="smpl">304 (Not Modified)</a> response (<a href="p4-conditional.html#status.304" title="304 Not Modified">Section 4.1</a> of <a href="#Part4" id="rfc.xref.Part4.2"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a>) to a GET request, neither of which includes a message body, to indicate that the origin server would have applied a transfer … … 1661 1663 that a client can be assured of buffering the entire response. 1662 1664 </p> 1663 <p id="rfc.section.4.3.p.7">When multiple transfer-codings are acceptable, the client <em class="bcp14">MAY</em> rank the codings by preference using a "q" parameter (similar to the qvalues used in content negotiation fields, <a href="p2-semantics.html#quality.values" title="Quality Values">Section 8.3</a> of <a href="#Part2" id="rfc.xref.Part2.11"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>). The rank value is a real number in the range 0 through 1, where 0.001 is the least preferred and 1 is the most preferred;1665 <p id="rfc.section.4.3.p.7">When multiple transfer-codings are acceptable, the client <em class="bcp14">MAY</em> rank the codings by preference using a "q" parameter (similar to the qvalues used in content negotiation fields, <a href="p2-semantics.html#quality.values" title="Quality Values">Section 9.3</a> of <a href="#Part2" id="rfc.xref.Part2.11"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>). The rank value is a real number in the range 0 through 1, where 0.001 is the least preferred and 1 is the most preferred; 1664 1666 a value of 0 means "not acceptable". 1665 1667 </p> … … 1685 1687 for client-side processing (<a href="#RFC3986" id="rfc.xref.RFC3986.18"><cite title="Uniform Resource Identifier (URI): Generic Syntax">[RFC3986]</cite></a>, <a href="http://tools.ietf.org/html/rfc3986#section-3.5">Section 3.5</a>). 1686 1688 </p> 1687 <p id="rfc.section.5.1.p.3">HTTP intermediaries obtain the request semantics and target URI from the request-line of an incoming request message.</p>1688 1689 <h2 id="rfc.section.5.2"><a href="#rfc.section.5.2">5.2</a> <a id="connecting.inbound" href="#connecting.inbound">Connecting Inbound</a></h2> 1689 1690 <p id="rfc.section.5.2.p.1">Once the target URI is determined, a client needs to decide whether a network request is necessary to accomplish the desired … … 1742 1743 </p> 1743 1744 <div id="authority-form"> 1744 <p id="rfc.section.5.3.p.13"><span id="rfc.iref.a.3"></span> The authority-form of request-target is only used for CONNECT requests (<a href="p2-semantics.html#CONNECT" title="CONNECT">Section 2.3.8</a> of <a href="#Part2" id="rfc.xref.Part2.13"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>). When making a CONNECT request to establish a tunnel through one or more proxies, a client <em class="bcp14">MUST</em> send only the target URI's authority component (excluding any userinfo) as the request-target. For example,1745 <p id="rfc.section.5.3.p.13"><span id="rfc.iref.a.3"></span> The authority-form of request-target is only used for CONNECT requests (<a href="p2-semantics.html#CONNECT" title="CONNECT">Section 3.3.8</a> of <a href="#Part2" id="rfc.xref.Part2.13"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>). When making a CONNECT request to establish a tunnel through one or more proxies, a client <em class="bcp14">MUST</em> send only the target URI's authority component (excluding any userinfo) as the request-target. For example, 1745 1746 </p> 1746 1747 </div> 1747 1748 <div id="rfc.figure.u.41"></div><pre class="text2">CONNECT www.example.com:80 HTTP/1.1 1748 1749 </pre><div id="asterisk-form"> 1749 <p id="rfc.section.5.3.p.15"><span id="rfc.iref.a.4"></span> The asterisk-form of request-target is only used for a server-wide OPTIONS request (<a href="p2-semantics.html#OPTIONS" title="OPTIONS">Section 2.3.1</a> of <a href="#Part2" id="rfc.xref.Part2.14"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>). When a client wishes to request OPTIONS for the server as a whole, as opposed to a specific named resource of that server,1750 <p id="rfc.section.5.3.p.15"><span id="rfc.iref.a.4"></span> The asterisk-form of request-target is only used for a server-wide OPTIONS request (<a href="p2-semantics.html#OPTIONS" title="OPTIONS">Section 3.3.1</a> of <a href="#Part2" id="rfc.xref.Part2.14"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>). When a client wishes to request OPTIONS for the server as a whole, as opposed to a specific named resource of that server, 1750 1751 the client <em class="bcp14">MUST</em> send only "*" (%x2A) as the request-target. For example, 1751 1752 </p> … … 1893 1894 </p> 1894 1895 <ul> 1895 <li><a href="p2-semantics.html#header.allow" class="smpl">Allow</a> (<a href="p2-semantics.html#header.allow" title="Allow">Section 9.5</a> of <a href="#Part2" id="rfc.xref.Part2.16"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>)1896 </li> 1897 <li><a href="p2-semantics.html#header.content-location" class="smpl">Content-Location</a> (<a href="p2-semantics.html#header.content-location" title="Content-Location">Section 9.8</a> of <a href="#Part2" id="rfc.xref.Part2.17"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>)1896 <li><a href="p2-semantics.html#header.allow" class="smpl">Allow</a> (<a href="p2-semantics.html#header.allow" title="Allow">Section 10.5</a> of <a href="#Part2" id="rfc.xref.Part2.16"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>) 1897 </li> 1898 <li><a href="p2-semantics.html#header.content-location" class="smpl">Content-Location</a> (<a href="p2-semantics.html#header.content-location" title="Content-Location">Section 10.8</a> of <a href="#Part2" id="rfc.xref.Part2.17"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>) 1898 1899 </li> 1899 1900 <li>Content-MD5 (<a href="http://tools.ietf.org/html/rfc2616#section-14.15">Section 14.15</a> of <a href="#RFC2616" id="rfc.xref.RFC2616.3"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a>) … … 1903 1904 <li><a href="p4-conditional.html#header.last-modified" class="smpl">Last-Modified</a> (<a href="p4-conditional.html#header.last-modified" title="Last-Modified">Section 2.2</a> of <a href="#Part4" id="rfc.xref.Part4.5"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a>) 1904 1905 </li> 1905 <li><a href="p2-semantics.html#header.server" class="smpl">Server</a> (<a href="p2-semantics.html#header.server" title="Server">Section 9.17</a> of <a href="#Part2" id="rfc.xref.Part2.18"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>)1906 <li><a href="p2-semantics.html#header.server" class="smpl">Server</a> (<a href="p2-semantics.html#header.server" title="Server">Section 10.17</a> of <a href="#Part2" id="rfc.xref.Part2.18"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>) 1906 1907 </li> 1907 1908 </ul> … … 1911 1912 </p> 1912 1913 <ul> 1913 <li><a href="p2-semantics.html#header.content-encoding" class="smpl">Content-Encoding</a> (<a href="p2-semantics.html#header.content-encoding" title="Content-Encoding">Section 9.6</a> of <a href="#Part2" id="rfc.xref.Part2.19"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>)1914 <li><a href="p2-semantics.html#header.content-encoding" class="smpl">Content-Encoding</a> (<a href="p2-semantics.html#header.content-encoding" title="Content-Encoding">Section 10.6</a> of <a href="#Part2" id="rfc.xref.Part2.19"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>) 1914 1915 </li> 1915 1916 <li><a href="p5-range.html#header.content-range" class="smpl">Content-Range</a> (<a href="p5-range.html#header.content-range" title="Content-Range">Section 5.2</a> of <a href="#Part5" id="rfc.xref.Part5.2"><cite title="HTTP/1.1, part 5: Range Requests">[Part5]</cite></a>) 1916 1917 </li> 1917 <li><a href="p2-semantics.html#header.content-type" class="smpl">Content-Type</a> (<a href="p2-semantics.html#header.content-type" title="Content-Type">Section 9.9</a> of <a href="#Part2" id="rfc.xref.Part2.20"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>)1918 <li><a href="p2-semantics.html#header.content-type" class="smpl">Content-Type</a> (<a href="p2-semantics.html#header.content-type" title="Content-Type">Section 10.9</a> of <a href="#Part2" id="rfc.xref.Part2.20"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>) 1918 1919 </li> 1919 1920 </ul> … … 1928 1929 <p id="rfc.section.5.9.p.1">HTTP does not include a request identifier for associating a given request message with its corresponding one or more response 1929 1930 messages. Hence, it relies on the order of response arrival to correspond exactly to the order in which requests are made 1930 on the same connection. More than one response message per request only occurs when one or more informational responses (<a href="p2-semantics.html#status.1xx" class="smpl">1xx</a>, see <a href="p2-semantics.html#status.1xx" title="Informational 1xx">Section 4.3</a> of <a href="#Part2" id="rfc.xref.Part2.21"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>) precede a final response to the same request.1931 on the same connection. More than one response message per request only occurs when one or more informational responses (<a href="p2-semantics.html#status.1xx" class="smpl">1xx</a>, see <a href="p2-semantics.html#status.1xx" title="Informational 1xx">Section 5.3</a> of <a href="#Part2" id="rfc.xref.Part2.21"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>) precede a final response to the same request. 1931 1932 </p> 1932 1933 <p id="rfc.section.5.9.p.2">A client that uses persistent connections and sends more than one request per connection <em class="bcp14">MUST</em> maintain a list of outstanding requests in the order sent on that connection and <em class="bcp14">MUST</em> associate each received response message to the highest ordered request that has not yet received a final (non-<a href="p2-semantics.html#status.1xx" class="smpl">1xx</a>) response. … … 2037 2038 <p id="rfc.section.6.2.2.1.p.2">Clients which assume persistent connections and pipeline immediately after connection establishment <em class="bcp14">SHOULD</em> be prepared to retry their connection if the first pipelined attempt fails. If a client does such a retry, it <em class="bcp14">MUST NOT</em> pipeline before it knows the connection is persistent. Clients <em class="bcp14">MUST</em> also be prepared to resend their requests if the server closes the connection before sending all of the corresponding responses. 2038 2039 </p> 2039 <p id="rfc.section.6.2.2.1.p.3">Clients <em class="bcp14">SHOULD NOT</em> pipeline requests using non-idempotent request methods or non-idempotent sequences of request methods (see <a href="p2-semantics.html#idempotent.methods" title="Idempotent Methods">Section 2.1.2</a> of <a href="#Part2" id="rfc.xref.Part2.22"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>). Otherwise, a premature termination of the transport connection could lead to indeterminate results. A client wishing to2040 <p id="rfc.section.6.2.2.1.p.3">Clients <em class="bcp14">SHOULD NOT</em> pipeline requests using non-idempotent request methods or non-idempotent sequences of request methods (see <a href="p2-semantics.html#idempotent.methods" title="Idempotent Methods">Section 3.1.2</a> of <a href="#Part2" id="rfc.xref.Part2.22"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>). Otherwise, a premature termination of the transport connection could lead to indeterminate results. A client wishing to 2040 2041 send a non-idempotent request <em class="bcp14">SHOULD</em> wait to send that request until it has received the response status line for the previous request. 2041 2042 </p> 2042 2043 <h4 id="rfc.section.6.2.2.2"><a href="#rfc.section.6.2.2.2">6.2.2.2</a> <a id="persistent.retrying.requests" href="#persistent.retrying.requests">Retrying Requests</a></h4> 2043 2044 <p id="rfc.section.6.2.2.2.p.1">Senders can close the transport connection at any time. Therefore, clients, servers, and proxies <em class="bcp14">MUST</em> be able to recover from asynchronous close events. Client software <em class="bcp14">MAY</em> reopen the transport connection and retransmit the aborted sequence of requests without user interaction so long as the request 2044 sequence is idempotent (see <a href="p2-semantics.html#idempotent.methods" title="Idempotent Methods">Section 2.1.2</a> of <a href="#Part2" id="rfc.xref.Part2.23"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>). Non-idempotent request methods or sequences <em class="bcp14">MUST NOT</em> be automatically retried, although user agents <em class="bcp14">MAY</em> offer a human operator the choice of retrying the request(s). Confirmation by user-agent software with semantic understanding2045 sequence is idempotent (see <a href="p2-semantics.html#idempotent.methods" title="Idempotent Methods">Section 3.1.2</a> of <a href="#Part2" id="rfc.xref.Part2.23"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>). Non-idempotent request methods or sequences <em class="bcp14">MUST NOT</em> be automatically retried, although user agents <em class="bcp14">MAY</em> offer a human operator the choice of retrying the request(s). Confirmation by user-agent software with semantic understanding 2045 2046 of the application <em class="bcp14">MAY</em> substitute for user confirmation. The automatic retry <em class="bcp14">SHOULD NOT</em> be repeated if the second sequence of requests fails. 2046 2047 </p> … … 2093 2094 </p> 2094 2095 <h2 id="rfc.section.6.3"><a href="#rfc.section.6.3">6.3</a> <a id="use.of.the.100.status" href="#use.of.the.100.status">Use of the 100 (Continue) Status</a></h2> 2095 <p id="rfc.section.6.3.p.1">The purpose of the <a href="p2-semantics.html#status.100" class="smpl">100 (Continue)</a> status code (see <a href="p2-semantics.html#status.100" title="100 Continue">Section 4.3.1</a> of <a href="#Part2" id="rfc.xref.Part2.24"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>) is to allow a client that is sending a request message with a request body to determine if the origin server is willing2096 <p id="rfc.section.6.3.p.1">The purpose of the <a href="p2-semantics.html#status.100" class="smpl">100 (Continue)</a> status code (see <a href="p2-semantics.html#status.100" title="100 Continue">Section 5.3.1</a> of <a href="#Part2" id="rfc.xref.Part2.24"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>) is to allow a client that is sending a request message with a request body to determine if the origin server is willing 2096 2097 to accept the request (based on the request header fields) before the client sends the request body. In some cases, it might 2097 2098 either be inappropriate or highly inefficient for the client to send the body if the server will reject the message without … … 2100 2101 <p id="rfc.section.6.3.p.2">Requirements for HTTP/1.1 clients: </p> 2101 2102 <ul> 2102 <li>If a client will wait for a <a href="p2-semantics.html#status.100" class="smpl">100 (Continue)</a> response before sending the request body, it <em class="bcp14">MUST</em> send an <a href="p2-semantics.html#header.expect" class="smpl">Expect</a> header field (<a href="p2-semantics.html#header.expect" title="Expect">Section 9.11</a> of <a href="#Part2" id="rfc.xref.Part2.25"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>) with the "100-continue" expectation.2103 <li>If a client will wait for a <a href="p2-semantics.html#status.100" class="smpl">100 (Continue)</a> response before sending the request body, it <em class="bcp14">MUST</em> send an <a href="p2-semantics.html#header.expect" class="smpl">Expect</a> header field (<a href="p2-semantics.html#header.expect" title="Expect">Section 10.11</a> of <a href="#Part2" id="rfc.xref.Part2.25"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>) with the "100-continue" expectation. 2103 2104 </li> 2104 2105 <li>A client <em class="bcp14">MUST NOT</em> send an <a href="p2-semantics.html#header.expect" class="smpl">Expect</a> header field with the "100-continue" expectation if it does not intend to send a request body. … … 2138 2139 <li>Proxies <em class="bcp14">SHOULD</em> maintain a record of the HTTP version numbers received from recently-referenced next-hop servers. 2139 2140 </li> 2140 <li>A proxy <em class="bcp14">MUST NOT</em> forward a <a href="p2-semantics.html#status.100" class="smpl">100 (Continue)</a> response if the request message was received from an HTTP/1.0 (or earlier) client and did not include an <a href="p2-semantics.html#header.expect" class="smpl">Expect</a> header field with the "100-continue" expectation. This requirement overrides the general rule for forwarding of <a href="p2-semantics.html#status.1xx" class="smpl">1xx</a> responses (see <a href="p2-semantics.html#status.1xx" title="Informational 1xx">Section 4.3</a> of <a href="#Part2" id="rfc.xref.Part2.26"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>).2141 <li>A proxy <em class="bcp14">MUST NOT</em> forward a <a href="p2-semantics.html#status.100" class="smpl">100 (Continue)</a> response if the request message was received from an HTTP/1.0 (or earlier) client and did not include an <a href="p2-semantics.html#header.expect" class="smpl">Expect</a> header field with the "100-continue" expectation. This requirement overrides the general rule for forwarding of <a href="p2-semantics.html#status.1xx" class="smpl">1xx</a> responses (see <a href="p2-semantics.html#status.1xx" title="Informational 1xx">Section 5.3</a> of <a href="#Part2" id="rfc.xref.Part2.26"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>). 2141 2142 </li> 2142 2143 </ul> … … 2169 2170 </p> 2170 2171 <p id="rfc.section.6.4.p.8">The Upgrade header field cannot be used to indicate a switch to a protocol on a different connection. For that purpose, it 2171 is more appropriate to use a <a href="p2-semantics.html#status.3xx" class="smpl">3xx (Redirection)</a> response (<a href="p2-semantics.html#status.3xx" title="Redirection 3xx">Section 4.5</a> of <a href="#Part2" id="rfc.xref.Part2.27"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>).2172 is more appropriate to use a <a href="p2-semantics.html#status.3xx" class="smpl">3xx (Redirection)</a> response (<a href="p2-semantics.html#status.3xx" title="Redirection 3xx">Section 5.5</a> of <a href="#Part2" id="rfc.xref.Part2.27"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>). 2172 2173 </p> 2173 2174 <p id="rfc.section.6.4.p.9">Servers <em class="bcp14">MUST</em> include the "Upgrade" header field in <a href="p2-semantics.html#status.101" class="smpl">101 (Switching … … 2433 2434 <li>Pointer to specification text</li> 2434 2435 </ul> 2435 <p id="rfc.section.7.4.p.3">Names of transfer codings <em class="bcp14">MUST NOT</em> overlap with names of content codings (<a href="p2-semantics.html#content.codings" title="Content Codings">Section 5.4</a> of <a href="#Part2" id="rfc.xref.Part2.28"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>) unless the encoding transformation is identical, as is the case for the compression codings defined in <a href="#compression.codings" title="Compression Codings">Section 4.2</a>.2436 <p id="rfc.section.7.4.p.3">Names of transfer codings <em class="bcp14">MUST NOT</em> overlap with names of content codings (<a href="p2-semantics.html#content.codings" title="Content Codings">Section 6.4</a> of <a href="#Part2" id="rfc.xref.Part2.28"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>) unless the encoding transformation is identical, as is the case for the compression codings defined in <a href="#compression.codings" title="Compression Codings">Section 4.2</a>. 2436 2437 </p> 2437 2438 <p id="rfc.section.7.4.p.4">Values to be added to this name space require IETF Review (see <a href="http://tools.ietf.org/html/rfc5226#section-4.1">Section 4.1</a> of <a href="#RFC5226" id="rfc.xref.RFC5226.1"><cite title="Guidelines for Writing an IANA Considerations Section in RFCs">[RFC5226]</cite></a>), and <em class="bcp14">MUST</em> conform to the purpose of transfer coding defined in this section. Use of program names for the identification of encoding … … 2589 2590 that most implementations will choose substantially higher limits. 2590 2591 </p> 2591 <p id="rfc.section.8.6.p.3">This specification also provides a way for servers to reject messages that have request-targets that are too long (<a href="p2-semantics.html#status.414" title="414 URI Too Long">Section 4.6.12</a> of <a href="#Part2" id="rfc.xref.Part2.29"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>) or request entities that are too large (<a href="p2-semantics.html#status.4xx" title="Client Error 4xx">Section 4.6</a> of <a href="#Part2" id="rfc.xref.Part2.30"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>).2592 <p id="rfc.section.8.6.p.3">This specification also provides a way for servers to reject messages that have request-targets that are too long (<a href="p2-semantics.html#status.414" title="414 URI Too Long">Section 5.6.12</a> of <a href="#Part2" id="rfc.xref.Part2.29"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>) or request entities that are too large (<a href="p2-semantics.html#status.4xx" title="Client Error 4xx">Section 5.6</a> of <a href="#Part2" id="rfc.xref.Part2.30"><cite title="HTTP/1.1, part 2: Semantics and Payloads">[Part2]</cite></a>). 2592 2593 </p> 2593 2594 <p id="rfc.section.8.6.p.4">Other fields (including but not limited to request methods, response status phrases, header field-names, and body chunks) <em class="bcp14">SHOULD</em> be limited by implementations carefully, so as to not impede interoperability. … … 3665 3666 <li><a id="rfc.index.P" href="#rfc.index.P"><b>P</b></a><ul> 3666 3667 <li><em>Part2</em> <a href="#rfc.xref.Part2.1">1</a>, <a href="#rfc.xref.Part2.2">2.1</a>, <a href="#rfc.xref.Part2.3">2.3</a>, <a href="#rfc.xref.Part2.4">2.7.1</a>, <a href="#rfc.xref.Part2.5">3.1.1</a>, <a href="#rfc.xref.Part2.6">3.1.1</a>, <a href="#rfc.xref.Part2.7">3.1.2</a>, <a href="#rfc.xref.Part2.8">3.2</a>, <a href="#rfc.xref.Part2.9">3.2</a>, <a href="#rfc.xref.Part2.10">3.3.1</a>, <a href="#rfc.xref.Part2.11">4.3</a>, <a href="#rfc.xref.Part2.12">5.1</a>, <a href="#rfc.xref.Part2.13">5.3</a>, <a href="#rfc.xref.Part2.14">5.3</a>, <a href="#rfc.xref.Part2.15">5.8</a>, <a href="#rfc.xref.Part2.16">5.8</a>, <a href="#rfc.xref.Part2.17">5.8</a>, <a href="#rfc.xref.Part2.18">5.8</a>, <a href="#rfc.xref.Part2.19">5.8</a>, <a href="#rfc.xref.Part2.20">5.8</a>, <a href="#rfc.xref.Part2.21">5.9</a>, <a href="#rfc.xref.Part2.22">6.2.2.1</a>, <a href="#rfc.xref.Part2.23">6.2.2.2</a>, <a href="#rfc.xref.Part2.24">6.3</a>, <a href="#rfc.xref.Part2.25">6.3</a>, <a href="#rfc.xref.Part2.26">6.3</a>, <a href="#rfc.xref.Part2.27">6.4</a>, <a href="#rfc.xref.Part2.28">7.4</a>, <a href="#rfc.xref.Part2.29">8.6</a>, <a href="#rfc.xref.Part2.30">8.6</a>, <a href="#Part2"><b>10.1</b></a><ul> 3667 <li><em>Section 2</em> <a href="#rfc.xref.Part2.5">3.1.1</a></li>3668 <li><em>Section 2.1.2</em> <a href="#rfc.xref.Part2.22">6.2.2.1</a>, <a href="#rfc.xref.Part2.23">6.2.2.2</a></li>3669 <li><em>Section 2.3.1</em> <a href="#rfc.xref.Part2.14">5.3</a></li>3670 <li><em>Section 2.3.8</em> <a href="#rfc.xref.Part2.13">5.3</a></li>3671 <li><em>Section 3.1</em> <a href="#rfc.xref.Part2.9">3.2</a></li>3672 <li><em>Section 4</em> <a href="#rfc.xref.Part2.4">2.7.1</a>, <a href="#rfc.xref.Part2.7">3.1.2</a></li>3673 <li><em>Section 4.3</em> <a href="#rfc.xref.Part2.21">5.9</a>, <a href="#rfc.xref.Part2.26">6.3</a></li>3674 <li><em>Section 4.3.1</em> <a href="#rfc.xref.Part2.24">6.3</a></li>3675 <li><em>Section 4.4.4</em> <a href="#rfc.xref.Part2.3">2.3</a></li>3676 <li><em>Section 4.5</em> <a href="#rfc.xref.Part2.27">6.4</a></li>3677 <li><em>Section 4.6</em> <a href="#rfc.xref.Part2.30">8.6</a></li>3678 <li><em>Section 4.6.12</em> <a href="#rfc.xref.Part2.6">3.1.1</a>, <a href="#rfc.xref.Part2.29">8.6</a></li>3679 <li><em>Section 5.4</em> <a href="#rfc.xref.Part2.10">3.3.1</a>, <a href="#rfc.xref.Part2.28">7.4</a></li>3680 <li><em>Section 8.3</em> <a href="#rfc.xref.Part2.11">4.3</a></li>3681 <li><em>Section 9.5</em> <a href="#rfc.xref.Part2.16">5.8</a></li>3682 <li><em>Section 9.6</em> <a href="#rfc.xref.Part2.19">5.8</a></li>3683 <li><em>Section 9.8</em> <a href="#rfc.xref.Part2.17">5.8</a></li>3684 <li><em>Section 9.9</em> <a href="#rfc.xref.Part2.20">5.8</a></li>3685 <li><em>Section 9.10</em> <a href="#rfc.xref.Part2.8">3.2</a></li>3686 <li><em>Section 9.11</em> <a href="#rfc.xref.Part2.25">6.3</a></li>3687 <li><em>Section 9.17</em> <a href="#rfc.xref.Part2.18">5.8</a></li>3668 <li><em>Section 3</em> <a href="#rfc.xref.Part2.5">3.1.1</a></li> 3669 <li><em>Section 3.1.2</em> <a href="#rfc.xref.Part2.22">6.2.2.1</a>, <a href="#rfc.xref.Part2.23">6.2.2.2</a></li> 3670 <li><em>Section 3.3.1</em> <a href="#rfc.xref.Part2.14">5.3</a></li> 3671 <li><em>Section 3.3.8</em> <a href="#rfc.xref.Part2.13">5.3</a></li> 3672 <li><em>Section 4.5</em> <a href="#rfc.xref.Part2.9">3.2</a></li> 3673 <li><em>Section 5</em> <a href="#rfc.xref.Part2.4">2.7.1</a>, <a href="#rfc.xref.Part2.7">3.1.2</a></li> 3674 <li><em>Section 5.3</em> <a href="#rfc.xref.Part2.21">5.9</a>, <a href="#rfc.xref.Part2.26">6.3</a></li> 3675 <li><em>Section 5.3.1</em> <a href="#rfc.xref.Part2.24">6.3</a></li> 3676 <li><em>Section 5.4.4</em> <a href="#rfc.xref.Part2.3">2.3</a></li> 3677 <li><em>Section 5.5</em> <a href="#rfc.xref.Part2.27">6.4</a></li> 3678 <li><em>Section 5.6</em> <a href="#rfc.xref.Part2.30">8.6</a></li> 3679 <li><em>Section 5.6.12</em> <a href="#rfc.xref.Part2.6">3.1.1</a>, <a href="#rfc.xref.Part2.29">8.6</a></li> 3680 <li><em>Section 6.4</em> <a href="#rfc.xref.Part2.10">3.3.1</a>, <a href="#rfc.xref.Part2.28">7.4</a></li> 3681 <li><em>Section 9.3</em> <a href="#rfc.xref.Part2.11">4.3</a></li> 3682 <li><em>Section 10.5</em> <a href="#rfc.xref.Part2.16">5.8</a></li> 3683 <li><em>Section 10.6</em> <a href="#rfc.xref.Part2.19">5.8</a></li> 3684 <li><em>Section 10.8</em> <a href="#rfc.xref.Part2.17">5.8</a></li> 3685 <li><em>Section 10.9</em> <a href="#rfc.xref.Part2.20">5.8</a></li> 3686 <li><em>Section 10.10</em> <a href="#rfc.xref.Part2.8">3.2</a></li> 3687 <li><em>Section 10.11</em> <a href="#rfc.xref.Part2.25">6.3</a></li> 3688 <li><em>Section 10.17</em> <a href="#rfc.xref.Part2.18">5.8</a></li> 3688 3689 <li><em>Appendix A</em> <a href="#rfc.xref.Part2.2">2.1</a></li> 3689 3690 </ul> -
draft-ietf-httpbis/latest/p1-messaging.xml
r1838 r1839 228 228 document are to be interpreted as described in <xref target="RFC2119"/>. 229 229 </t> 230 <t> 231 Conformance criteria and considerations regarding error handling 232 are defined in <xref target="conformance"/>. 233 </t> 230 234 </section> 231 235 … … 609 613 </section> 610 614 611 <section title="Conformance and Error Handling" anchor=" intro.conformance.and.error.handling">615 <section title="Conformance and Error Handling" anchor="conformance"> 612 616 <t> 613 617 This specification targets conformance criteria according to the role of … … 2132 2136 since fragment identifiers are reserved for client-side processing 2133 2137 (<xref target="RFC3986" x:fmt="," x:sec="3.5"/>). 2134 </t>2135 <t>2136 HTTP intermediaries obtain the request semantics and target URI2137 from the request-line of an incoming request message.2138 2138 </t> 2139 2139 </section> -
draft-ietf-httpbis/latest/p2-semantics.html
r1831 r1839 449 449 } 450 450 @bottom-center { 451 content: "Expires February 2 0, 2013";451 content: "Expires February 26, 2013"; 452 452 } 453 453 @bottom-right { … … 472 472 <link rel="Index" href="#rfc.index"> 473 473 <link rel="Chapter" title="1 Introduction" href="#rfc.section.1"> 474 <link rel="Chapter" title="2 Methods" href="#rfc.section.2"> 475 <link rel="Chapter" title="3 Header Fields" href="#rfc.section.3"> 476 <link rel="Chapter" title="4 Status Codes" href="#rfc.section.4"> 477 <link rel="Chapter" title="5 Protocol Parameters" href="#rfc.section.5"> 478 <link rel="Chapter" title="6 Payload" href="#rfc.section.6"> 479 <link rel="Chapter" title="7 Representation" href="#rfc.section.7"> 480 <link rel="Chapter" title="8 Content Negotiation" href="#rfc.section.8"> 481 <link rel="Chapter" title="9 Header Field Definitions" href="#rfc.section.9"> 482 <link rel="Chapter" title="10 IANA Considerations" href="#rfc.section.10"> 483 <link rel="Chapter" title="11 Security Considerations" href="#rfc.section.11"> 484 <link rel="Chapter" title="12 Acknowledgments" href="#rfc.section.12"> 485 <link rel="Chapter" href="#rfc.section.13" title="13 References"> 474 <link rel="Chapter" title="2 Resource" href="#rfc.section.2"> 475 <link rel="Chapter" title="3 Request Methods" href="#rfc.section.3"> 476 <link rel="Chapter" title="4 Header Fields" href="#rfc.section.4"> 477 <link rel="Chapter" title="5 Response Status Codes" href="#rfc.section.5"> 478 <link rel="Chapter" title="6 Protocol Parameters" href="#rfc.section.6"> 479 <link rel="Chapter" title="7 Payload" href="#rfc.section.7"> 480 <link rel="Chapter" title="8 Representation" href="#rfc.section.8"> 481 <link rel="Chapter" title="9 Content Negotiation" href="#rfc.section.9"> 482 <link rel="Chapter" title="10 Header Field Definitions" href="#rfc.section.10"> 483 <link rel="Chapter" title="11 IANA Considerations" href="#rfc.section.11"> 484 <link rel="Chapter" title="12 Security Considerations" href="#rfc.section.12"> 485 <link rel="Chapter" title="13 Acknowledgments" href="#rfc.section.13"> 486 <link rel="Chapter" href="#rfc.section.14" title="14 References"> 486 487 <link rel="Appendix" title="A Differences between HTTP and MIME" href="#rfc.section.A"> 487 488 <link rel="Appendix" title="B Additional Features" href="#rfc.section.B"> … … 498 499 <meta name="dct.creator" content="Reschke, J. F."> 499 500 <meta name="dct.identifier" content="urn:ietf:id:draft-ietf-httpbis-p2-semantics-latest"> 500 <meta name="dct.issued" scheme="ISO8601" content="2012-08- 19">501 <meta name="dct.issued" scheme="ISO8601" content="2012-08-25"> 501 502 <meta name="dct.replaces" content="urn:ietf:rfc:2616"> 502 503 <meta name="dct.abstract" content="The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypertext information systems. This document defines the semantics of HTTP/1.1 messages, as expressed by request methods, request header fields, response status codes, and response header fields, along with the payload of messages (metadata and body content) and mechanisms for content negotiation."> … … 529 530 </tr> 530 531 <tr> 531 <td class="left">Expires: February 2 0, 2013</td>532 <td class="left">Expires: February 26, 2013</td> 532 533 <td class="right">greenbytes</td> 533 534 </tr> 534 535 <tr> 535 536 <td class="left"></td> 536 <td class="right">August 19, 2012</td>537 <td class="right">August 25, 2012</td> 537 538 </tr> 538 539 </tbody> … … 561 562 in progress”. 562 563 </p> 563 <p>This Internet-Draft will expire on February 2 0, 2013.</p>564 <p>This Internet-Draft will expire on February 26, 2013.</p> 564 565 <h1><a id="rfc.copyrightnotice" href="#rfc.copyrightnotice">Copyright Notice</a></h1> 565 566 <p>Copyright © 2012 IETF Trust and the persons identified as the document authors. All rights reserved.</p> … … 580 581 <ul class="toc"> 581 582 <li><a href="#rfc.section.1">1.</a> <a href="#introduction">Introduction</a><ul> 582 <li><a href="#rfc.section.1.1">1.1</a> <a href="# intro.conformance.and.error.handling">Conformance and Error Handling</a></li>583 <li><a href="#rfc.section.1.1">1.1</a> <a href="#conformance">Conformance and Error Handling</a></li> 583 584 <li><a href="#rfc.section.1.2">1.2</a> <a href="#notation">Syntax Notation</a></li> 584 585 </ul> 585 586 </li> 586 <li><a href="#rfc.section.2">2.</a> <a href="#methods">Methods</a><ul> 587 <li><a href="#rfc.section.2.1">2.1</a> <a href="#safe.and.idempotent">Safe and Idempotent Methods</a><ul> 588 <li><a href="#rfc.section.2.1.1">2.1.1</a> <a href="#safe.methods">Safe Methods</a></li> 589 <li><a href="#rfc.section.2.1.2">2.1.2</a> <a href="#idempotent.methods">Idempotent Methods</a></li> 587 <li><a href="#rfc.section.2">2.</a> <a href="#resource">Resource</a></li> 588 <li><a href="#rfc.section.3">3.</a> <a href="#methods">Request Methods</a><ul> 589 <li><a href="#rfc.section.3.1">3.1</a> <a href="#method.properties">Common Method Properties</a><ul> 590 <li><a href="#rfc.section.3.1.1">3.1.1</a> <a href="#safe.methods">Safe Methods</a></li> 591 <li><a href="#rfc.section.3.1.2">3.1.2</a> <a href="#idempotent.methods">Idempotent Methods</a></li> 590 592 </ul> 591 593 </li> 592 <li><a href="#rfc.section. 2.2">2.2</a> <a href="#method.registry">Method Registry</a><ul>593 <li><a href="#rfc.section. 2.2.1">2.2.1</a> <a href="#considerations.for.new.methods">Considerations for New Methods</a></li>594 <li><a href="#rfc.section.3.2">3.2</a> <a href="#method.registry">Method Registry</a><ul> 595 <li><a href="#rfc.section.3.2.1">3.2.1</a> <a href="#considerations.for.new.methods">Considerations for New Methods</a></li> 594 596 </ul> 595 597 </li> 596 <li><a href="#rfc.section. 2.3">2.3</a> <a href="#method.definitions">Method Definitions</a><ul>597 <li><a href="#rfc.section. 2.3.1">2.3.1</a> <a href="#OPTIONS">OPTIONS</a></li>598 <li><a href="#rfc.section. 2.3.2">2.3.2</a> <a href="#GET">GET</a></li>599 <li><a href="#rfc.section. 2.3.3">2.3.3</a> <a href="#HEAD">HEAD</a></li>600 <li><a href="#rfc.section. 2.3.4">2.3.4</a> <a href="#POST">POST</a></li>601 <li><a href="#rfc.section. 2.3.5">2.3.5</a> <a href="#PUT">PUT</a></li>602 <li><a href="#rfc.section. 2.3.6">2.3.6</a> <a href="#DELETE">DELETE</a></li>603 <li><a href="#rfc.section. 2.3.7">2.3.7</a> <a href="#TRACE">TRACE</a></li>604 <li><a href="#rfc.section. 2.3.8">2.3.8</a> <a href="#CONNECT">CONNECT</a></li>598 <li><a href="#rfc.section.3.3">3.3</a> <a href="#method.definitions">Method Definitions</a><ul> 599 <li><a href="#rfc.section.3.3.1">3.3.1</a> <a href="#OPTIONS">OPTIONS</a></li> 600 <li><a href="#rfc.section.3.3.2">3.3.2</a> <a href="#GET">GET</a></li> 601 <li><a href="#rfc.section.3.3.3">3.3.3</a> <a href="#HEAD">HEAD</a></li> 602 <li><a href="#rfc.section.3.3.4">3.3.4</a> <a href="#POST">POST</a></li> 603 <li><a href="#rfc.section.3.3.5">3.3.5</a> <a href="#PUT">PUT</a></li> 604 <li><a href="#rfc.section.3.3.6">3.3.6</a> <a href="#DELETE">DELETE</a></li> 605 <li><a href="#rfc.section.3.3.7">3.3.7</a> <a href="#TRACE">TRACE</a></li> 606 <li><a href="#rfc.section.3.3.8">3.3.8</a> <a href="#CONNECT">CONNECT</a></li> 605 607 </ul> 606 608 </li> 607 609 </ul> 608 610 </li> 609 <li><a href="#rfc.section.3">3.</a> <a href="#header.fields">Header Fields</a><ul> 610 <li><a href="#rfc.section.3.1">3.1</a> <a href="#considerations.for.creating.header.fields">Considerations for Creating Header Fields</a></li> 611 <li><a href="#rfc.section.3.2">3.2</a> <a href="#request.header.fields">Request Header Fields</a></li> 612 <li><a href="#rfc.section.3.3">3.3</a> <a href="#response.header.fields">Response Header Fields</a></li> 611 <li><a href="#rfc.section.4">4.</a> <a href="#header.fields">Header Fields</a><ul> 612 <li><a href="#rfc.section.4.1">4.1</a> <a href="#request.fields">Request-modifier Header Fields</a></li> 613 <li><a href="#rfc.section.4.2">4.2</a> <a href="#response.fields">Status-modifier Header Fields</a></li> 614 <li><a href="#rfc.section.4.3">4.3</a> <a href="#resource.fields">Resource Metadata Fields</a></li> 615 <li><a href="#rfc.section.4.4">4.4</a> <a href="#payload.fields">Payload Metadata Fields</a></li> 616 <li><a href="#rfc.section.4.5">4.5</a> <a href="#considerations.for.creating.header.fields">Considerations for Creating Header Fields</a></li> 617 <li><a href="#rfc.section.4.6">4.6</a> <a href="#request.header.fields">Request Header Fields</a></li> 618 <li><a href="#rfc.section.4.7">4.7</a> <a href="#response.header.fields">Response Header Fields</a></li> 613 619 </ul> 614 620 </li> 615 <li><a href="#rfc.section. 4">4.</a> <a href="#status.codes">Status Codes</a><ul>616 <li><a href="#rfc.section. 4.1">4.1</a> <a href="#overview.of.status.codes">Overview of Status Codes</a></li>617 <li><a href="#rfc.section. 4.2">4.2</a> <a href="#status.code.registry">Status Code Registry</a><ul>618 <li><a href="#rfc.section. 4.2.1">4.2.1</a> <a href="#considerations.for.new.status.codes">Considerations for New Status Codes</a></li>621 <li><a href="#rfc.section.5">5.</a> <a href="#status.codes">Response Status Codes</a><ul> 622 <li><a href="#rfc.section.5.1">5.1</a> <a href="#overview.of.status.codes">Overview of Status Codes</a></li> 623 <li><a href="#rfc.section.5.2">5.2</a> <a href="#status.code.registry">Status Code Registry</a><ul> 624 <li><a href="#rfc.section.5.2.1">5.2.1</a> <a href="#considerations.for.new.status.codes">Considerations for New Status Codes</a></li> 619 625 </ul> 620 626 </li> 621 <li><a href="#rfc.section. 4.3">4.3</a> <a href="#status.1xx">Informational 1xx</a><ul>622 <li><a href="#rfc.section. 4.3.1">4.3.1</a> <a href="#status.100">100 Continue</a></li>623 <li><a href="#rfc.section. 4.3.2">4.3.2</a> <a href="#status.101">101 Switching Protocols</a></li>627 <li><a href="#rfc.section.5.3">5.3</a> <a href="#status.1xx">Informational 1xx</a><ul> 628 <li><a href="#rfc.section.5.3.1">5.3.1</a> <a href="#status.100">100 Continue</a></li> 629 <li><a href="#rfc.section.5.3.2">5.3.2</a> <a href="#status.101">101 Switching Protocols</a></li> 624 630 </ul> 625 631 </li> 626 <li><a href="#rfc.section. 4.4">4.4</a> <a href="#status.2xx">Successful 2xx</a><ul>627 <li><a href="#rfc.section. 4.4.1">4.4.1</a> <a href="#status.200">200 OK</a></li>628 <li><a href="#rfc.section. 4.4.2">4.4.2</a> <a href="#status.201">201 Created</a></li>629 <li><a href="#rfc.section. 4.4.3">4.4.3</a> <a href="#status.202">202 Accepted</a></li>630 <li><a href="#rfc.section. 4.4.4">4.4.4</a> <a href="#status.203">203 Non-Authoritative Information</a></li>631 <li><a href="#rfc.section. 4.4.5">4.4.5</a> <a href="#status.204">204 No Content</a></li>632 <li><a href="#rfc.section. 4.4.6">4.4.6</a> <a href="#status.205">205 Reset Content</a></li>632 <li><a href="#rfc.section.5.4">5.4</a> <a href="#status.2xx">Successful 2xx</a><ul> 633 <li><a href="#rfc.section.5.4.1">5.4.1</a> <a href="#status.200">200 OK</a></li> 634 <li><a href="#rfc.section.5.4.2">5.4.2</a> <a href="#status.201">201 Created</a></li> 635 <li><a href="#rfc.section.5.4.3">5.4.3</a> <a href="#status.202">202 Accepted</a></li> 636 <li><a href="#rfc.section.5.4.4">5.4.4</a> <a href="#status.203">203 Non-Authoritative Information</a></li> 637 <li><a href="#rfc.section.5.4.5">5.4.5</a> <a href="#status.204">204 No Content</a></li> 638 <li><a href="#rfc.section.5.4.6">5.4.6</a> <a href="#status.205">205 Reset Content</a></li> 633 639 </ul> 634 640 </li> 635 <li><a href="#rfc.section. 4.5">4.5</a> <a href="#status.3xx">Redirection 3xx</a><ul>636 <li><a href="#rfc.section. 4.5.1">4.5.1</a> <a href="#status.300">300 Multiple Choices</a></li>637 <li><a href="#rfc.section. 4.5.2">4.5.2</a> <a href="#status.301">301 Moved Permanently</a></li>638 <li><a href="#rfc.section. 4.5.3">4.5.3</a> <a href="#status.302">302 Found</a></li>639 <li><a href="#rfc.section. 4.5.4">4.5.4</a> <a href="#status.303">303 See Other</a></li>640 <li><a href="#rfc.section. 4.5.5">4.5.5</a> <a href="#status.305">305 Use Proxy</a></li>641 <li><a href="#rfc.section. 4.5.6">4.5.6</a> <a href="#status.306">306 (Unused)</a></li>642 <li><a href="#rfc.section. 4.5.7">4.5.7</a> <a href="#status.307">307 Temporary Redirect</a></li>641 <li><a href="#rfc.section.5.5">5.5</a> <a href="#status.3xx">Redirection 3xx</a><ul> 642 <li><a href="#rfc.section.5.5.1">5.5.1</a> <a href="#status.300">300 Multiple Choices</a></li> 643 <li><a href="#rfc.section.5.5.2">5.5.2</a> <a href="#status.301">301 Moved Permanently</a></li> 644 <li><a href="#rfc.section.5.5.3">5.5.3</a> <a href="#status.302">302 Found</a></li> 645 <li><a href="#rfc.section.5.5.4">5.5.4</a> <a href="#status.303">303 See Other</a></li> 646 <li><a href="#rfc.section.5.5.5">5.5.5</a> <a href="#status.305">305 Use Proxy</a></li> 647 <li><a href="#rfc.section.5.5.6">5.5.6</a> <a href="#status.306">306 (Unused)</a></li> 648 <li><a href="#rfc.section.5.5.7">5.5.7</a> <a href="#status.307">307 Temporary Redirect</a></li> 643 649 </ul> 644 650 </li> 645 <li><a href="#rfc.section. 4.6">4.6</a> <a href="#status.4xx">Client Error 4xx</a><ul>646 <li><a href="#rfc.section. 4.6.1">4.6.1</a> <a href="#status.400">400 Bad Request</a></li>647 <li><a href="#rfc.section. 4.6.2">4.6.2</a> <a href="#status.402">402 Payment Required</a></li>648 <li><a href="#rfc.section. 4.6.3">4.6.3</a> <a href="#status.403">403 Forbidden</a></li>649 <li><a href="#rfc.section. 4.6.4">4.6.4</a> <a href="#status.404">404 Not Found</a></li>650 <li><a href="#rfc.section. 4.6.5">4.6.5</a> <a href="#status.405">405 Method Not Allowed</a></li>651 <li><a href="#rfc.section. 4.6.6">4.6.6</a> <a href="#status.406">406 Not Acceptable</a></li>652 <li><a href="#rfc.section. 4.6.7">4.6.7</a> <a href="#status.408">408 Request Timeout</a></li>653 <li><a href="#rfc.section. 4.6.8">4.6.8</a> <a href="#status.409">409 Conflict</a></li>654 <li><a href="#rfc.section. 4.6.9">4.6.9</a> <a href="#status.410">410 Gone</a></li>655 <li><a href="#rfc.section. 4.6.10">4.6.10</a> <a href="#status.411">411 Length Required</a></li>656 <li><a href="#rfc.section. 4.6.11">4.6.11</a> <a href="#status.413">413 Request Representation Too Large</a></li>657 <li><a href="#rfc.section. 4.6.12">4.6.12</a> <a href="#status.414">414 URI Too Long</a></li>658 <li><a href="#rfc.section. 4.6.13">4.6.13</a> <a href="#status.415">415 Unsupported Media Type</a></li>659 <li><a href="#rfc.section. 4.6.14">4.6.14</a> <a href="#status.417">417 Expectation Failed</a></li>660 <li><a href="#rfc.section. 4.6.15">4.6.15</a> <a href="#status.426">426 Upgrade Required</a></li>651 <li><a href="#rfc.section.5.6">5.6</a> <a href="#status.4xx">Client Error 4xx</a><ul> 652 <li><a href="#rfc.section.5.6.1">5.6.1</a> <a href="#status.400">400 Bad Request</a></li> 653 <li><a href="#rfc.section.5.6.2">5.6.2</a> <a href="#status.402">402 Payment Required</a></li> 654 <li><a href="#rfc.section.5.6.3">5.6.3</a> <a href="#status.403">403 Forbidden</a></li> 655 <li><a href="#rfc.section.5.6.4">5.6.4</a> <a href="#status.404">404 Not Found</a></li> 656 <li><a href="#rfc.section.5.6.5">5.6.5</a> <a href="#status.405">405 Method Not Allowed</a></li> 657 <li><a href="#rfc.section.5.6.6">5.6.6</a> <a href="#status.406">406 Not Acceptable</a></li> 658 <li><a href="#rfc.section.5.6.7">5.6.7</a> <a href="#status.408">408 Request Timeout</a></li> 659 <li><a href="#rfc.section.5.6.8">5.6.8</a> <a href="#status.409">409 Conflict</a></li> 660 <li><a href="#rfc.section.5.6.9">5.6.9</a> <a href="#status.410">410 Gone</a></li> 661 <li><a href="#rfc.section.5.6.10">5.6.10</a> <a href="#status.411">411 Length Required</a></li> 662 <li><a href="#rfc.section.5.6.11">5.6.11</a> <a href="#status.413">413 Request Representation Too Large</a></li> 663 <li><a href="#rfc.section.5.6.12">5.6.12</a> <a href="#status.414">414 URI Too Long</a></li> 664 <li><a href="#rfc.section.5.6.13">5.6.13</a> <a href="#status.415">415 Unsupported Media Type</a></li> 665 <li><a href="#rfc.section.5.6.14">5.6.14</a> <a href="#status.417">417 Expectation Failed</a></li> 666 <li><a href="#rfc.section.5.6.15">5.6.15</a> <a href="#status.426">426 Upgrade Required</a></li> 661 667 </ul> 662 668 </li> 663 <li><a href="#rfc.section. 4.7">4.7</a> <a href="#status.5xx">Server Error 5xx</a><ul>664 <li><a href="#rfc.section. 4.7.1">4.7.1</a> <a href="#status.500">500 Internal Server Error</a></li>665 <li><a href="#rfc.section. 4.7.2">4.7.2</a> <a href="#status.501">501 Not Implemented</a></li>666 <li><a href="#rfc.section. 4.7.3">4.7.3</a> <a href="#status.502">502 Bad Gateway</a></li>667 <li><a href="#rfc.section. 4.7.4">4.7.4</a> <a href="#status.503">503 Service Unavailable</a></li>668 <li><a href="#rfc.section. 4.7.5">4.7.5</a> <a href="#status.504">504 Gateway Timeout</a></li>669 <li><a href="#rfc.section. 4.7.6">4.7.6</a> <a href="#status.505">505 HTTP Version Not Supported</a></li>669 <li><a href="#rfc.section.5.7">5.7</a> <a href="#status.5xx">Server Error 5xx</a><ul> 670 <li><a href="#rfc.section.5.7.1">5.7.1</a> <a href="#status.500">500 Internal Server Error</a></li> 671 <li><a href="#rfc.section.5.7.2">5.7.2</a> <a href="#status.501">501 Not Implemented</a></li> 672 <li><a href="#rfc.section.5.7.3">5.7.3</a> <a href="#status.502">502 Bad Gateway</a></li> 673 <li><a href="#rfc.section.5.7.4">5.7.4</a> <a href="#status.503">503 Service Unavailable</a></li> 674 <li><a href="#rfc.section.5.7.5">5.7.5</a> <a href="#status.504">504 Gateway Timeout</a></li> 675 <li><a href="#rfc.section.5.7.6">5.7.6</a> <a href="#status.505">505 HTTP Version Not Supported</a></li> 670 676 </ul> 671 677 </li> 672 678 </ul> 673 679 </li> 674 <li><a href="#rfc.section. 5">5.</a> <a href="#protocol.parameters">Protocol Parameters</a><ul>675 <li><a href="#rfc.section. 5.1">5.1</a> <a href="#http.date">Date/Time Formats</a></li>676 <li><a href="#rfc.section. 5.2">5.2</a> <a href="#product.tokens">Product Tokens</a></li>677 <li><a href="#rfc.section. 5.3">5.3</a> <a href="#character.sets">Character Encodings (charset)</a></li>678 <li><a href="#rfc.section. 5.4">5.4</a> <a href="#content.codings">Content Codings</a><ul>679 <li><a href="#rfc.section. 5.4.1">5.4.1</a> <a href="#content.coding.registry">Content Coding Registry</a></li>680 <li><a href="#rfc.section.6">6.</a> <a href="#protocol.parameters">Protocol Parameters</a><ul> 681 <li><a href="#rfc.section.6.1">6.1</a> <a href="#http.date">Date/Time Formats</a></li> 682 <li><a href="#rfc.section.6.2">6.2</a> <a href="#product.tokens">Product Tokens</a></li> 683 <li><a href="#rfc.section.6.3">6.3</a> <a href="#character.sets">Character Encodings (charset)</a></li> 684 <li><a href="#rfc.section.6.4">6.4</a> <a href="#content.codings">Content Codings</a><ul> 685 <li><a href="#rfc.section.6.4.1">6.4.1</a> <a href="#content.coding.registry">Content Coding Registry</a></li> 680 686 </ul> 681 687 </li> 682 <li><a href="#rfc.section. 5.5">5.5</a> <a href="#media.types">Media Types</a><ul>683 <li><a href="#rfc.section. 5.5.1">5.5.1</a> <a href="#canonicalization.and.text.defaults">Canonicalization and Text Defaults</a></li>684 <li><a href="#rfc.section. 5.5.2">5.5.2</a> <a href="#multipart.types">Multipart Types</a></li>688 <li><a href="#rfc.section.6.5">6.5</a> <a href="#media.types">Media Types</a><ul> 689 <li><a href="#rfc.section.6.5.1">6.5.1</a> <a href="#canonicalization.and.text.defaults">Canonicalization and Text Defaults</a></li> 690 <li><a href="#rfc.section.6.5.2">6.5.2</a> <a href="#multipart.types">Multipart Types</a></li> 685 691 </ul> 686 692 </li> 687 <li><a href="#rfc.section. 5.6">5.6</a> <a href="#language.tags">Language Tags</a></li>693 <li><a href="#rfc.section.6.6">6.6</a> <a href="#language.tags">Language Tags</a></li> 688 694 </ul> 689 695 </li> 690 <li><a href="#rfc.section. 6">6.</a> <a href="#payload">Payload</a><ul>691 <li><a href="#rfc.section. 6.1">6.1</a> <a href="#payload.header.fields">Payload Header Fields</a></li>692 <li><a href="#rfc.section. 6.2">6.2</a> <a href="#payload.body">Payload Body</a></li>696 <li><a href="#rfc.section.7">7.</a> <a href="#payload">Payload</a><ul> 697 <li><a href="#rfc.section.7.1">7.1</a> <a href="#payload.header.fields">Payload Header Fields</a></li> 698 <li><a href="#rfc.section.7.2">7.2</a> <a href="#payload.body">Payload Body</a></li> 693 699 </ul> 694 700 </li> 695 <li><a href="#rfc.section. 7">7.</a> <a href="#representation">Representation</a><ul>696 <li><a href="#rfc.section. 7.1">7.1</a> <a href="#identifying.response.associated.with.representation">Identifying the Resource Associated with a Representation</a></li>697 <li><a href="#rfc.section. 7.2">7.2</a> <a href="#representation.header.fields">Representation Header Fields</a></li>698 <li><a href="#rfc.section. 7.3">7.3</a> <a href="#representation.data">Representation Data</a></li>701 <li><a href="#rfc.section.8">8.</a> <a href="#representation">Representation</a><ul> 702 <li><a href="#rfc.section.8.1">8.1</a> <a href="#identifying.response.associated.with.representation">Identifying the Resource Associated with a Representation</a></li> 703 <li><a href="#rfc.section.8.2">8.2</a> <a href="#representation.header.fields">Representation Header Fields</a></li> 704 <li><a href="#rfc.section.8.3">8.3</a> <a href="#representation.data">Representation Data</a></li> 699 705 </ul> 700 706 </li> 701 <li><a href="#rfc.section. 8">8.</a> <a href="#content.negotiation">Content Negotiation</a><ul>702 <li><a href="#rfc.section. 8.1">8.1</a> <a href="#server-driven.negotiation">Server-driven Negotiation</a></li>703 <li><a href="#rfc.section. 8.2">8.2</a> <a href="#agent-driven.negotiation">Agent-driven Negotiation</a></li>704 <li><a href="#rfc.section. 8.3">8.3</a> <a href="#quality.values">Quality Values</a></li>707 <li><a href="#rfc.section.9">9.</a> <a href="#content.negotiation">Content Negotiation</a><ul> 708 <li><a href="#rfc.section.9.1">9.1</a> <a href="#server-driven.negotiation">Server-driven Negotiation</a></li> 709 <li><a href="#rfc.section.9.2">9.2</a> <a href="#agent-driven.negotiation">Agent-driven Negotiation</a></li> 710 <li><a href="#rfc.section.9.3">9.3</a> <a href="#quality.values">Quality Values</a></li> 705 711 </ul> 706 712 </li> 707 <li><a href="#rfc.section. 9">9.</a> <a href="#header.field.definitions">Header Field Definitions</a><ul>708 <li><a href="#rfc.section. 9.1">9.1</a> <a href="#header.accept">Accept</a></li>709 <li><a href="#rfc.section. 9.2">9.2</a> <a href="#header.accept-charset">Accept-Charset</a></li>710 <li><a href="#rfc.section. 9.3">9.3</a> <a href="#header.accept-encoding">Accept-Encoding</a></li>711 <li><a href="#rfc.section. 9.4">9.4</a> <a href="#header.accept-language">Accept-Language</a></li>712 <li><a href="#rfc.section. 9.5">9.5</a> <a href="#header.allow">Allow</a></li>713 <li><a href="#rfc.section. 9.6">9.6</a> <a href="#header.content-encoding">Content-Encoding</a></li>714 <li><a href="#rfc.section. 9.7">9.7</a> <a href="#header.content-language">Content-Language</a></li>715 <li><a href="#rfc.section. 9.8">9.8</a> <a href="#header.content-location">Content-Location</a></li>716 <li><a href="#rfc.section. 9.9">9.9</a> <a href="#header.content-type">Content-Type</a></li>717 <li><a href="#rfc.section. 9.10">9.10</a> <a href="#header.date">Date</a></li>718 <li><a href="#rfc.section. 9.11">9.11</a> <a href="#header.expect">Expect</a></li>719 <li><a href="#rfc.section. 9.12">9.12</a> <a href="#header.from">From</a></li>720 <li><a href="#rfc.section. 9.13">9.13</a> <a href="#header.location">Location</a></li>721 <li><a href="#rfc.section. 9.14">9.14</a> <a href="#header.max-forwards">Max-Forwards</a></li>722 <li><a href="#rfc.section. 9.15">9.15</a> <a href="#header.referer">Referer</a></li>723 <li><a href="#rfc.section. 9.16">9.16</a> <a href="#header.retry-after">Retry-After</a></li>724 <li><a href="#rfc.section. 9.17">9.17</a> <a href="#header.server">Server</a></li>725 <li><a href="#rfc.section. 9.18">9.18</a> <a href="#header.user-agent">User-Agent</a></li>713 <li><a href="#rfc.section.10">10.</a> <a href="#header.field.definitions">Header Field Definitions</a><ul> 714 <li><a href="#rfc.section.10.1">10.1</a> <a href="#header.accept">Accept</a></li> 715 <li><a href="#rfc.section.10.2">10.2</a> <a href="#header.accept-charset">Accept-Charset</a></li> 716 <li><a href="#rfc.section.10.3">10.3</a> <a href="#header.accept-encoding">Accept-Encoding</a></li> 717 <li><a href="#rfc.section.10.4">10.4</a> <a href="#header.accept-language">Accept-Language</a></li> 718 <li><a href="#rfc.section.10.5">10.5</a> <a href="#header.allow">Allow</a></li> 719 <li><a href="#rfc.section.10.6">10.6</a> <a href="#header.content-encoding">Content-Encoding</a></li> 720 <li><a href="#rfc.section.10.7">10.7</a> <a href="#header.content-language">Content-Language</a></li> 721 <li><a href="#rfc.section.10.8">10.8</a> <a href="#header.content-location">Content-Location</a></li> 722 <li><a href="#rfc.section.10.9">10.9</a> <a href="#header.content-type">Content-Type</a></li> 723 <li><a href="#rfc.section.10.10">10.10</a> <a href="#header.date">Date</a></li> 724 <li><a href="#rfc.section.10.11">10.11</a> <a href="#header.expect">Expect</a></li> 725 <li><a href="#rfc.section.10.12">10.12</a> <a href="#header.from">From</a></li> 726 <li><a href="#rfc.section.10.13">10.13</a> <a href="#header.location">Location</a></li> 727 <li><a href="#rfc.section.10.14">10.14</a> <a href="#header.max-forwards">Max-Forwards</a></li> 728 <li><a href="#rfc.section.10.15">10.15</a> <a href="#header.referer">Referer</a></li> 729 <li><a href="#rfc.section.10.16">10.16</a> <a href="#header.retry-after">Retry-After</a></li> 730 <li><a href="#rfc.section.10.17">10.17</a> <a href="#header.server">Server</a></li> 731 <li><a href="#rfc.section.10.18">10.18</a> <a href="#header.user-agent">User-Agent</a></li> 726 732 </ul> 727 733 </li> 728 <li><a href="#rfc.section.1 0">10.</a> <a href="#IANA.considerations">IANA Considerations</a><ul>729 <li><a href="#rfc.section.1 0.1">10.1</a> <a href="#method.registration">Method Registry</a></li>730 <li><a href="#rfc.section.1 0.2">10.2</a> <a href="#status.code.registration">Status Code Registry</a></li>731 <li><a href="#rfc.section.1 0.3">10.3</a> <a href="#header.field.registration">Header Field Registration</a></li>732 <li><a href="#rfc.section.1 0.4">10.4</a> <a href="#content.coding.registration">Content Coding Registry</a></li>734 <li><a href="#rfc.section.11">11.</a> <a href="#IANA.considerations">IANA Considerations</a><ul> 735 <li><a href="#rfc.section.11.1">11.1</a> <a href="#method.registration">Method Registry</a></li> 736 <li><a href="#rfc.section.11.2">11.2</a> <a href="#status.code.registration">Status Code Registry</a></li> 737 <li><a href="#rfc.section.11.3">11.3</a> <a href="#header.field.registration">Header Field Registration</a></li> 738 <li><a href="#rfc.section.11.4">11.4</a> <a href="#content.coding.registration">Content Coding Registry</a></li> 733 739 </ul> 734 740 </li> 735 <li><a href="#rfc.section.1 1">11.</a> <a href="#security.considerations">Security Considerations</a><ul>736 <li><a href="#rfc.section.1 1.1">11.1</a> <a href="#security.sensitive">Transfer of Sensitive Information</a></li>737 <li><a href="#rfc.section.1 1.2">11.2</a> <a href="#encoding.sensitive.information.in.uris">Encoding Sensitive Information in URIs</a></li>738 <li><a href="#rfc.section.1 1.3">11.3</a> <a href="#location.spoofing-leakage">Location Header Fields: Spoofing and Information Leakage</a></li>739 <li><a href="#rfc.section.1 1.4">11.4</a> <a href="#rfc.section.11.4">Security Considerations for CONNECT</a></li>740 <li><a href="#rfc.section.1 1.5">11.5</a> <a href="#privacy.issues.connected.to.accept.header.fields">Privacy Issues Connected to Accept Header Fields</a></li>741 <li><a href="#rfc.section.12">12.</a> <a href="#security.considerations">Security Considerations</a><ul> 742 <li><a href="#rfc.section.12.1">12.1</a> <a href="#security.sensitive">Transfer of Sensitive Information</a></li> 743 <li><a href="#rfc.section.12.2">12.2</a> <a href="#encoding.sensitive.information.in.uris">Encoding Sensitive Information in URIs</a></li> 744 <li><a href="#rfc.section.12.3">12.3</a> <a href="#location.spoofing-leakage">Location Header Fields: Spoofing and Information Leakage</a></li> 745 <li><a href="#rfc.section.12.4">12.4</a> <a href="#rfc.section.12.4">Security Considerations for CONNECT</a></li> 746 <li><a href="#rfc.section.12.5">12.5</a> <a href="#privacy.issues.connected.to.accept.header.fields">Privacy Issues Connected to Accept Header Fields</a></li> 741 747 </ul> 742 748 </li> 743 <li><a href="#rfc.section.1 2">12.</a> <a href="#acks">Acknowledgments</a></li>744 <li><a href="#rfc.section.1 3">13.</a> <a href="#rfc.references">References</a><ul>745 <li><a href="#rfc.section.1 3.1">13.1</a> <a href="#rfc.references.1">Normative References</a></li>746 <li><a href="#rfc.section.1 3.2">13.2</a> <a href="#rfc.references.2">Informative References</a></li>749 <li><a href="#rfc.section.13">13.</a> <a href="#acks">Acknowledgments</a></li> 750 <li><a href="#rfc.section.14">14.</a> <a href="#rfc.references">References</a><ul> 751 <li><a href="#rfc.section.14.1">14.1</a> <a href="#rfc.references.1">Normative References</a></li> 752 <li><a href="#rfc.section.14.2">14.2</a> <a href="#rfc.references.2">Informative References</a></li> 747 753 </ul> 748 754 </li> … … 810 816 <p id="rfc.section.1.p.1">Each HTTP message is either a request or a response. A server listens on a connection for a request, parses each message received, 811 817 interprets the message semantics in relation to the identified request target, and responds to that request with one or more 812 response messages. This document defines HTTP/1.1 request and response semantics in terms of the architecture, syntax notation, 813 and conformance criteria defined in <a href="#Part1" id="rfc.xref.Part1.1"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>. 818 response messages. This document defines HTTP/1.1 request and response semantics in terms of the architecture defined in <a href="#Part1" id="rfc.xref.Part1.1"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>. 814 819 </p> 815 820 <p id="rfc.section.1.p.2">HTTP provides a uniform interface for interacting with resources regardless of their type, nature, or implementation. HTTP 816 semantics includes the intentions defined by each request method, extensions to those semantics that might be described in 817 request header fields, the meaning of status codes to indicate a machine-readable response, and additional control data and 818 resource metadata that might be given in response header fields. 821 semantics includes the intentions defined by each request method (<a href="#methods" title="Request Methods">Section 3</a>), extensions to those semantics that might be described in request header fields (<a href="#request.fields" title="Request-modifier Header Fields">Section 4.1</a>), the meaning of status codes to indicate a machine-readable response (<a href="#status.codes" title="Response Status Codes">Section 5</a>), and other control data and resource metadata that might be given in response header fields. 819 822 </p> 820 823 <p id="rfc.section.1.p.3"><span id="rfc.iref.c.1"></span> In addition, this document defines the payload of messages (a.k.a., content), the associated metadata header fields that define … … 822 825 and the various selection algorithms that are collectively referred to as "<dfn>content negotiation</dfn>". 823 826 </p> 824 <div class="note" id="rfc.section.1.p.4"> 825 <p> <b>Note:</b> This document is currently disorganized in order to minimize changes between drafts and enable reviewers to see the smaller 826 errata changes. A future draft will reorganize the sections to better reflect the content. In particular, the sections will 827 be ordered according to the typical processing of an HTTP request message (after message parsing): resource mapping, methods, 828 request modifying header fields, response status, status modifying header fields, and resource metadata. The current mess 829 reflects how widely dispersed these topics and associated requirements had become in <a href="#RFC2616" id="rfc.xref.RFC2616.1"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a>. 830 </p> 831 </div> 832 <h2 id="rfc.section.1.1"><a href="#rfc.section.1.1">1.1</a> <a id="intro.conformance.and.error.handling" href="#intro.conformance.and.error.handling">Conformance and Error Handling</a></h2> 827 <h2 id="rfc.section.1.1"><a href="#rfc.section.1.1">1.1</a> <a id="conformance" href="#conformance">Conformance and Error Handling</a></h2> 833 828 <p id="rfc.section.1.1.p.1">The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" 834 829 in this document are to be interpreted as described in <a href="#RFC2119" id="rfc.xref.RFC2119.1"><cite title="Key words for use in RFCs to Indicate Requirement Levels">[RFC2119]</cite></a>. 835 830 </p> 836 <p id="rfc.section.1.1.p.2">This specification targets conformance criteria according to the role of a participant in HTTP communication. Hence, HTTP 837 requirements are placed on senders, recipients, clients, servers, user agents, intermediaries, origin servers, proxies, gateways, 838 or caches, depending on what behavior is being constrained by the requirement. See <a href="p1-messaging.html#architecture" title="Architecture">Section 2</a> of <a href="#Part1" id="rfc.xref.Part1.2"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a> for definitions of these terms. 839 </p> 840 <p id="rfc.section.1.1.p.3">The verb "generate" is used instead of "send" where a requirement differentiates between creating a protocol element and merely 841 forwarding a received element downstream. 842 </p> 843 <p id="rfc.section.1.1.p.4">An implementation is considered conformant if it complies with all of the requirements associated with the roles it partakes 844 in HTTP. Note that SHOULD-level requirements are relevant here, unless one of the documented exceptions is applicable. 845 </p> 846 <p id="rfc.section.1.1.p.5">This document also uses ABNF to define valid protocol elements (<a href="#notation" title="Syntax Notation">Section 1.2</a>). In addition to the prose requirements placed upon them, senders <em class="bcp14">MUST NOT</em> generate protocol elements that do not match the grammar defined by the ABNF rules for those protocol elements that are applicable 847 to the sender's role. If a received protocol element is processed, the recipient <em class="bcp14">MUST</em> be able to parse any value that would match the ABNF rules for that protocol element, excluding only those rules not applicable 848 to the recipient's role. 849 </p> 850 <p id="rfc.section.1.1.p.6">Unless noted otherwise, a recipient <em class="bcp14">MAY</em> attempt to recover a usable protocol element from an invalid construct. HTTP does not define specific error handling mechanisms 851 except when they have a direct impact on security, since different applications of the protocol require different error handling 852 strategies. For example, a Web browser might wish to transparently recover from a response where the <a href="#header.location" class="smpl">Location</a> header field doesn't parse according to the ABNF, whereas a systems control client might consider any form of error recovery 853 to be dangerous. 831 <p id="rfc.section.1.1.p.2">Conformance criteria and considerations regarding error handling are defined in <a href="p1-messaging.html#conformance" title="Conformance and Error Handling">Section 2.5</a> of <a href="#Part1" id="rfc.xref.Part1.2"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>. 854 832 </p> 855 833 <h2 id="rfc.section.1.2"><a href="#rfc.section.1.2">1.2</a> <a id="notation" href="#notation">Syntax Notation</a></h2> 856 834 <p id="rfc.section.1.2.p.1">This specification uses the Augmented Backus-Naur Form (ABNF) notation of <a href="#RFC5234" id="rfc.xref.RFC5234.1"><cite title="Augmented BNF for Syntax Specifications: ABNF">[RFC5234]</cite></a> with the list rule extension defined in <a href="p1-messaging.html#notation" title="Syntax Notation">Section 1.2</a> of <a href="#Part1" id="rfc.xref.Part1.3"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>. <a href="#imported.abnf" title="Imported ABNF">Appendix D</a> describes rules imported from other documents. <a href="#collected.abnf" title="Collected ABNF">Appendix E</a> shows the collected ABNF with the list rule expanded. 857 835 </p> 858 <h1 id="rfc.section.2"><a href="#rfc.section.2">2.</a> <a id="methods" href="#methods">Methods</a></h1> 859 <p id="rfc.section.2.p.1">The method token indicates the request method to be performed on the target resource (<a href="p1-messaging.html#effective.request.uri" title="Effective Request URI">Section 5.5</a> of <a href="#Part1" id="rfc.xref.Part1.4"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>). The method is case-sensitive. 860 </p> 861 <div id="rfc.figure.u.1"></div><pre class="inline"><span id="rfc.iref.g.1"></span> <a href="#methods" class="smpl">method</a> = <a href="#imported.abnf" class="smpl">token</a> 862 </pre><p id="rfc.section.2.p.3">The list of methods allowed by a resource can be specified in an <a href="#header.allow" class="smpl">Allow</a> header field (<a href="#header.allow" id="rfc.xref.header.allow.1" title="Allow">Section 9.5</a>). The status code of the response always notifies the client whether a method is currently allowed on a resource, since the 863 set of allowed methods can change dynamically. An origin server <em class="bcp14">SHOULD</em> respond with the status code <a href="#status.405" class="smpl">405 (Method Not Allowed)</a> if the method is known by the origin server but not allowed for the resource, and <a href="#status.501" class="smpl">501 (Not 864 Implemented)</a> if the method is unrecognized or not implemented by the origin server. The methods GET and HEAD <em class="bcp14">MUST</em> be supported by all general-purpose servers. All other methods are <em class="bcp14">OPTIONAL</em>; however, if the above methods are implemented, they <em class="bcp14">MUST</em> be implemented with the same semantics as those specified in <a href="#method.definitions" title="Method Definitions">Section 2.3</a>. 865 </p> 866 <h2 id="rfc.section.2.1"><a href="#rfc.section.2.1">2.1</a> <a id="safe.and.idempotent" href="#safe.and.idempotent">Safe and Idempotent Methods</a></h2> 836 <h1 id="rfc.section.2"><a href="#rfc.section.2">2.</a> <a id="resource" href="#resource">Resource</a></h1> 837 <p id="rfc.section.2.p.1">The target of each HTTP request is called a resource. HTTP does not limit the nature of a resource; it merely defines an interface 838 that might be used to interact with resources. Each resource is identified by a Uniform Resource Identifier (URI), as described 839 in <a href="p1-messaging.html#uri" title="Uniform Resource Identifiers">Section 2.7</a> of <a href="#Part1" id="rfc.xref.Part1.4"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>. 840 </p> 841 <p id="rfc.section.2.p.2">When a client constructs an HTTP/1.1 request message, it sends the "target URI" in one of various forms, as defined in (<a href="p1-messaging.html#request-target" title="Request Target">Section 5.3</a> of <a href="#Part1" id="rfc.xref.Part1.5"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>). When a request is received, the server reconstructs an "effective request URI" for the target resource (<a href="p1-messaging.html#effective.request.uri" title="Effective Request URI">Section 5.5</a> of <a href="#Part1" id="rfc.xref.Part1.6"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>). 842 </p> 843 <p id="rfc.section.2.p.3">One design goal of HTTP is to separate resource identification from request semantics, which is made possible by vesting the 844 request semantics in the request method (<a href="#methods" title="Request Methods">Section 3</a>) and a few request-modifying header fields (<a href="#request.fields" title="Request-modifier Header Fields">Section 4.1</a>). Resource owners <em class="bcp14">SHOULD NOT</em> include request semantics within a URI, such as by specifying an action to invoke within the path or query components of the 845 effective request URI, unless those semantics are disabled when they are inconsistent with the request method. 846 </p> 847 <h1 id="rfc.section.3"><a href="#rfc.section.3">3.</a> <a id="methods" href="#methods">Request Methods</a></h1> 848 <p id="rfc.section.3.p.1">The request method token is the primary source of request semantics; it indicates the purpose for which the client has made 849 this request and what is expected by the client as a successful result. The request semantics <em class="bcp14">MAY</em> be further specialized by the semantics of some header fields when present in a request (<a href="#request.fields" title="Request-modifier Header Fields">Section 4.1</a>) if those additional semantics do not conflict with the method. 850 </p> 851 <div id="rfc.figure.u.1"></div><pre class="inline"><span id="rfc.iref.g.1"></span> <a href="#methods" class="smpl">method</a> = <a href="#imported.abnf" class="smpl">token</a> 852 </pre><p id="rfc.section.3.p.3">HTTP was originally designed to be usable as an interface to distributed object systems. The request method was envisioned 853 as applying semantics to a target resource in much the same way as invoking a defined method on an identified object would 854 apply semantics. The method token is case-sensitive because it might be used as a gateway to object-based systems with case-sensitive 855 method names. 856 </p> 857 <p id="rfc.section.3.p.4">Unlike distributed objects, the standardized request methods in HTTP are not resource-specific, since uniform interfaces provide 858 for better visibility and reuse in network-based systems <a href="#REST" id="rfc.xref.REST.1"><cite title="Architectural Styles and the Design of Network-based Software Architectures">[REST]</cite></a>. Once defined, a standardized method <em class="bcp14">MUST</em> have the same semantics when applied to any resource, though each resource determines for itself whether those semantics are 859 implemented or allowed. 860 </p> 861 <p id="rfc.section.3.p.5">This specification defines a number of standardized methods that are commonly used in HTTP, as outlined by the following table. 862 By convention, standardized methods are defined in all-uppercase ASCII letters. 863 </p> 864 <div id="rfc.table.1"> 865 <div id="method.overview"></div> 866 <table class="tt full left" cellpadding="3" cellspacing="0"> 867 <thead> 868 <tr> 869 <th>Method</th> 870 <th>Description</th> 871 <th>Sec.</th> 872 </tr> 873 </thead> 874 <tbody> 875 <tr> 876 <td class="left">GET</td> 877 <td class="left">Retrieve a current representation of the target resource.</td> 878 <td class="left"><a href="#GET" id="rfc.xref.GET.1" title="GET">3.3.2</a></td> 879 </tr> 880 <tr> 881 <td class="left">HEAD</td> 882 <td class="left">Same as GET, but do not include a message body in the response.</td> 883 <td class="left"><a href="#HEAD" id="rfc.xref.HEAD.1" title="HEAD">3.3.3</a></td> 884 </tr> 885 <tr> 886 <td class="left">POST</td> 887 <td class="left">Perform resource-specific processing on the request payload.</td> 888 <td class="left"><a href="#POST" id="rfc.xref.POST.1" title="POST">3.3.4</a></td> 889 </tr> 890 <tr> 891 <td class="left">PUT</td> 892 <td class="left">Replace all current representations of the target resource with the request payload.</td> 893 <td class="left"><a href="#PUT" id="rfc.xref.PUT.1" title="PUT">3.3.5</a></td> 894 </tr> 895 <tr> 896 <td class="left">DELETE</td> 897 <td class="left">Remove all current representations of the target resource.</td> 898 <td class="left"><a href="#DELETE" id="rfc.xref.DELETE.1" title="DELETE">3.3.6</a></td> 899 </tr> 900 <tr> 901 <td class="left">CONNECT</td> 902 <td class="left">Establish a tunnel to the server identified by the target resource.</td> 903 <td class="left"><a href="#CONNECT" id="rfc.xref.CONNECT.1" title="CONNECT">3.3.8</a></td> 904 </tr> 905 <tr> 906 <td class="left">OPTIONS</td> 907 <td class="left">Describe the communication options for the target resource.</td> 908 <td class="left"><a href="#OPTIONS" id="rfc.xref.OPTIONS.1" title="OPTIONS">3.3.1</a></td> 909 </tr> 910 <tr> 911 <td class="left">TRACE</td> 912 <td class="left">Perform a message loop-back test along the path to the target resource.</td> 913 <td class="left"><a href="#TRACE" id="rfc.xref.TRACE.1" title="TRACE">3.3.7</a></td> 914 </tr> 915 </tbody> 916 </table> 917 </div> 918 <p id="rfc.section.3.p.6">The methods GET and HEAD <em class="bcp14">MUST</em> be supported by all general-purpose servers. All other methods are <em class="bcp14">OPTIONAL</em>. If one of the above methods is implemented by a server, the server <em class="bcp14">MUST</em> implement that method according to the semantics defined for it in <a href="#method.definitions" title="Method Definitions">Section 3.3</a>. 919 </p> 920 <p id="rfc.section.3.p.7">Additional methods <em class="bcp14">MAY</em> be used in HTTP. New methods <em class="bcp14">SHOULD</em> be registered within the IANA registry, as defined in <a href="#method.registry" title="Method Registry">Section 3.2</a>. 921 </p> 922 <p id="rfc.section.3.p.8">The set of methods allowed by a target resource can be listed in an <a href="#header.allow" class="smpl">Allow</a> header field (<a href="#header.allow" id="rfc.xref.header.allow.1" title="Allow">Section 10.5</a>). However, the set of allowed methods can change dynamically. When a request message is received that is unrecognized or 923 not implemented by an origin server, the origin server <em class="bcp14">SHOULD</em> respond with the <a href="#status.501" class="smpl">501 (Not Implemented)</a> status code. When a request message is received that is known by an origin server but not allowed for the target resource, 924 the origin server <em class="bcp14">SHOULD</em> respond with the <a href="#status.405" class="smpl">405 (Method Not Allowed)</a> status code. 925 </p> 926 <h2 id="rfc.section.3.1"><a href="#rfc.section.3.1">3.1</a> <a id="method.properties" href="#method.properties">Common Method Properties</a></h2> 867 927 <div id="rfc.iref.s.1"></div> 868 <h3 id="rfc.section.2.1.1"><a href="#rfc.section.2.1.1">2.1.1</a> <a id="safe.methods" href="#safe.methods">Safe Methods</a></h3> 869 <p id="rfc.section.2.1.1.p.1">Implementers need to be aware that the software represents the user in their interactions over the Internet, and need to allow 870 the user to be aware of any actions they take which might have an unexpected significance to themselves or others. 871 </p> 872 <p id="rfc.section.2.1.1.p.2">In particular, the convention has been established that the GET, HEAD, OPTIONS, and TRACE request methods <em class="bcp14">SHOULD NOT</em> have the significance of taking an action other than retrieval. These request methods ought to be considered "<dfn id="safe">safe</dfn>". This allows user agents to represent other methods, such as POST, PUT and DELETE, in a special way, so that the user is 873 made aware of the fact that a possibly unsafe action is being requested. 874 </p> 875 <p id="rfc.section.2.1.1.p.3">Naturally, it is not possible to ensure that the server does not generate side-effects as a result of performing a GET request; 876 in fact, some dynamic resources consider that a feature. The important distinction here is that the user did not request the 877 side-effects, so therefore cannot be held accountable for them. 928 <h3 id="rfc.section.3.1.1"><a href="#rfc.section.3.1.1">3.1.1</a> <a id="safe.methods" href="#safe.methods">Safe Methods</a></h3> 929 <p id="rfc.section.3.1.1.p.1">Request methods are considered "<dfn id="safe">safe</dfn>" if their defined semantics are essentially read-only; i.e., the user does not request, and does not expect, any state change 930 on the origin server as a result of applying a safe method to a target resource. Likewise, reasonable use of a safe method 931 is not expected to cause any harm, loss of property, or unusual burden on the origin server. 932 </p> 933 <p id="rfc.section.3.1.1.p.2">This definition of safe methods does not prevent an implementation from including behavior that is potentially harmful, not 934 entirely read-only, or which causes side-effects while invoking a safe method. In fact, some dynamic resources might consider 935 that a feature. What is important, however, is that the user did not request that additional behavior and cannot be held accountable 936 for it. For example, most servers append request information to access log files at the completion of every response, regardless 937 of the method, and that is considered safe even though the log storage might become full and crash the server. 938 </p> 939 <p id="rfc.section.3.1.1.p.3">The GET, HEAD, OPTIONS, and TRACE request methods are defined to be safe.</p> 940 <p id="rfc.section.3.1.1.p.4">A user agent <em class="bcp14">SHOULD</em> distinguish between safe and unsafe methods when presenting potential actions to a user, such that the user can be made aware 941 of an unsafe action before it is requested. A user agent <em class="bcp14">SHOULD NOT</em> make requests using unsafe methods as an automated result of the user selecting a safe action, unless the instruction for 942 making the unsafe request came from the same origin server as the request target. 943 </p> 944 <p id="rfc.section.3.1.1.p.5">When a resource is constructed such that parameters within the effective request URI have the effect of selecting an action, 945 it is the resource owner's responsibility to ensure that the action is consistent with the request method semantics. For example, 946 it is common for HTML form-based content editing software to use actions within query parameters, such as "page?do=delete". 947 If the purpose of such a resource is to perform an unsafe action, then the resource <em class="bcp14">MUST</em> disable or disallow that action when it is accessed using a safe request method. Failure to do so will result in unfortunate 948 side-effects when automated processes perform a GET on every URI reference, which often occurs for the sake of link maintenance, 949 pre-fetching, or building a search index. 878 950 </p> 879 951 <div id="rfc.iref.i.1"></div> 880 <h3 id="rfc.section. 2.1.2"><a href="#rfc.section.2.1.2">2.1.2</a> <a id="idempotent.methods" href="#idempotent.methods">Idempotent Methods</a></h3>881 <p id="rfc.section. 2.1.2.p.1">Request methods can also have the property of "idempotence" in that, aside from error or expiration issues, the intended effect952 <h3 id="rfc.section.3.1.2"><a href="#rfc.section.3.1.2">3.1.2</a> <a id="idempotent.methods" href="#idempotent.methods">Idempotent Methods</a></h3> 953 <p id="rfc.section.3.1.2.p.1">Request methods can also have the property of "idempotence" in that, aside from error or expiration issues, the intended effect 882 954 of multiple identical requests is the same as for a single request. PUT, DELETE, and all safe request methods are idempotent. 883 955 It is important to note that idempotence refers only to changes requested by the client: a server is free to change its state 884 956 due to multiple requests for the purpose of tracking those requests, versioning of results, etc. 885 957 </p> 886 <h2 id="rfc.section. 2.2"><a href="#rfc.section.2.2">2.2</a> <a id="method.registry" href="#method.registry">Method Registry</a></h2>887 <p id="rfc.section. 2.2.p.1">The HTTP Method Registry defines the name space for the method token in the Request line of an HTTP request.</p>888 <p id="rfc.section. 2.2.p.2">Registrations <em class="bcp14">MUST</em> include the following fields:889 </p> 890 <ul> 891 <li>Method Name (see <a href="#methods" title=" Methods">Section 2</a>)892 </li> 893 <li>Safe ("yes" or "no", see <a href="#safe.methods" title="Safe Methods">Section 2.1.1</a>)894 </li> 895 <li>Idempotent ("yes" or "no", see <a href="#safe.methods" title="Safe Methods">Section 2.1.1</a>)958 <h2 id="rfc.section.3.2"><a href="#rfc.section.3.2">3.2</a> <a id="method.registry" href="#method.registry">Method Registry</a></h2> 959 <p id="rfc.section.3.2.p.1">The HTTP Method Registry defines the name space for the method token in the Request line of an HTTP request.</p> 960 <p id="rfc.section.3.2.p.2">Registrations <em class="bcp14">MUST</em> include the following fields: 961 </p> 962 <ul> 963 <li>Method Name (see <a href="#methods" title="Request Methods">Section 3</a>) 964 </li> 965 <li>Safe ("yes" or "no", see <a href="#safe.methods" title="Safe Methods">Section 3.1.1</a>) 966 </li> 967 <li>Idempotent ("yes" or "no", see <a href="#safe.methods" title="Safe Methods">Section 3.1.1</a>) 896 968 </li> 897 969 <li>Pointer to specification text</li> 898 970 </ul> 899 <p id="rfc.section. 2.2.p.3">Values to be added to this name space require IETF Review (see <a href="#RFC5226" id="rfc.xref.RFC5226.1"><cite title="Guidelines for Writing an IANA Considerations Section in RFCs">[RFC5226]</cite></a>, <a href="http://tools.ietf.org/html/rfc5226#section-4.1">Section 4.1</a>).900 </p> 901 <p id="rfc.section. 2.2.p.4">The registry itself is maintained at <<a href="http://www.iana.org/assignments/http-methods">http://www.iana.org/assignments/http-methods</a>>.902 </p> 903 <h3 id="rfc.section. 2.2.1"><a href="#rfc.section.2.2.1">2.2.1</a> <a id="considerations.for.new.methods" href="#considerations.for.new.methods">Considerations for New Methods</a></h3>904 <p id="rfc.section. 2.2.1.p.1">When it is necessary to express new semantics for a HTTP request that aren't specific to a single application or media type,971 <p id="rfc.section.3.2.p.3">Values to be added to this name space require IETF Review (see <a href="#RFC5226" id="rfc.xref.RFC5226.1"><cite title="Guidelines for Writing an IANA Considerations Section in RFCs">[RFC5226]</cite></a>, <a href="http://tools.ietf.org/html/rfc5226#section-4.1">Section 4.1</a>). 972 </p> 973 <p id="rfc.section.3.2.p.4">The registry itself is maintained at <<a href="http://www.iana.org/assignments/http-methods">http://www.iana.org/assignments/http-methods</a>>. 974 </p> 975 <h3 id="rfc.section.3.2.1"><a href="#rfc.section.3.2.1">3.2.1</a> <a id="considerations.for.new.methods" href="#considerations.for.new.methods">Considerations for New Methods</a></h3> 976 <p id="rfc.section.3.2.1.p.1">When it is necessary to express new semantics for a HTTP request that aren't specific to a single application or media type, 905 977 and currently defined methods are inadequate, it might be appropriate to register a new method. 906 978 </p> 907 <p id="rfc.section. 2.2.1.p.2">HTTP methods are generic; that is, they are potentially applicable to any resource, not just one particular media type, "type"979 <p id="rfc.section.3.2.1.p.2">HTTP methods are generic; that is, they are potentially applicable to any resource, not just one particular media type, "type" 908 980 of resource, or application. As such, it is preferred that new HTTP methods be registered in a document that isn't specific 909 981 to a single application, so that this is clear. 910 982 </p> 911 <p id="rfc.section. 2.2.1.p.3">Due to the parsing rules defined in <a href="p1-messaging.html#message.body" title="Message Body">Section 3.3</a> of <a href="#Part1" id="rfc.xref.Part1.5"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>, definitions of HTTP methods cannot prohibit the presence of a message body on either the request or the response message983 <p id="rfc.section.3.2.1.p.3">Due to the parsing rules defined in <a href="p1-messaging.html#message.body" title="Message Body">Section 3.3</a> of <a href="#Part1" id="rfc.xref.Part1.7"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>, definitions of HTTP methods cannot prohibit the presence of a message body on either the request or the response message 912 984 (with responses to HEAD requests being the single exception). Definitions of new methods cannot change this rule, but they 913 985 can specify that only zero-length bodies (as opposed to absent bodies) are allowed. 914 986 </p> 915 <p id="rfc.section. 2.2.1.p.4">New method definitions need to indicate whether they are safe (<a href="#safe.methods" title="Safe Methods">Section 2.1.1</a>), what semantics (if any) the request body has, and whether they are idempotent (<a href="#idempotent.methods" title="Idempotent Methods">Section 2.1.2</a>). They also need to state whether they can be cached (<a href="#Part6" id="rfc.xref.Part6.1"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>); in particular under what conditions a cache can store the response, and under what conditions such a stored response can987 <p id="rfc.section.3.2.1.p.4">New method definitions need to indicate whether they are safe (<a href="#safe.methods" title="Safe Methods">Section 3.1.1</a>), what semantics (if any) the request body has, and whether they are idempotent (<a href="#idempotent.methods" title="Idempotent Methods">Section 3.1.2</a>). They also need to state whether they can be cached (<a href="#Part6" id="rfc.xref.Part6.1"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>); in particular under what conditions a cache can store the response, and under what conditions such a stored response can 916 988 be used to satisfy a subsequent request. 917 989 </p> 918 <h2 id="rfc.section. 2.3"><a href="#rfc.section.2.3">2.3</a> <a id="method.definitions" href="#method.definitions">Method Definitions</a></h2>919 <h3 id="rfc.section. 2.3.1"><a href="#rfc.section.2.3.1">2.3.1</a> <a id="OPTIONS" href="#OPTIONS">OPTIONS</a></h3>990 <h2 id="rfc.section.3.3"><a href="#rfc.section.3.3">3.3</a> <a id="method.definitions" href="#method.definitions">Method Definitions</a></h2> 991 <h3 id="rfc.section.3.3.1"><a href="#rfc.section.3.3.1">3.3.1</a> <a id="OPTIONS" href="#OPTIONS">OPTIONS</a></h3> 920 992 <div id="rfc.iref.o.1"></div> 921 993 <div id="rfc.iref.m.1"></div> 922 <p id="rfc.section. 2.3.1.p.1">The OPTIONS method requests information about the communication options available on the request/response chain identified994 <p id="rfc.section.3.3.1.p.1">The OPTIONS method requests information about the communication options available on the request/response chain identified 923 995 by the effective request URI. This method allows a client to determine the options and/or requirements associated with a resource, 924 996 or the capabilities of a server, without implying a resource action or initiating a resource retrieval. 925 997 </p> 926 <p id="rfc.section. 2.3.1.p.2">Responses to the OPTIONS method are not cacheable.</p>927 <p id="rfc.section. 2.3.1.p.3">If the OPTIONS request includes a message body (as indicated by the presence of <a href="p1-messaging.html#header.content-length" class="smpl">Content-Length</a> or <a href="p1-messaging.html#header.transfer-encoding" class="smpl">Transfer-Encoding</a>), then the media type <em class="bcp14">MUST</em> be indicated by a <a href="#header.content-type" class="smpl">Content-Type</a> field. Although this specification does not define any use for such a body, future extensions to HTTP might use the OPTIONS998 <p id="rfc.section.3.3.1.p.2">Responses to the OPTIONS method are not cacheable.</p> 999 <p id="rfc.section.3.3.1.p.3">If the OPTIONS request includes a message body (as indicated by the presence of <a href="p1-messaging.html#header.content-length" class="smpl">Content-Length</a> or <a href="p1-messaging.html#header.transfer-encoding" class="smpl">Transfer-Encoding</a>), then the media type <em class="bcp14">MUST</em> be indicated by a <a href="#header.content-type" class="smpl">Content-Type</a> field. Although this specification does not define any use for such a body, future extensions to HTTP might use the OPTIONS 928 1000 body to make more detailed queries on the server. 929 1001 </p> 930 <p id="rfc.section. 2.3.1.p.4">If the request-target (<a href="p1-messaging.html#request-target" title="Request Target">Section 5.3</a> of <a href="#Part1" id="rfc.xref.Part1.6"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>) is an asterisk ("*"), the OPTIONS request is intended to apply to the server in general rather than to a specific resource.1002 <p id="rfc.section.3.3.1.p.4">If the request-target (<a href="p1-messaging.html#request-target" title="Request Target">Section 5.3</a> of <a href="#Part1" id="rfc.xref.Part1.8"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>) is an asterisk ("*"), the OPTIONS request is intended to apply to the server in general rather than to a specific resource. 931 1003 Since a server's communication options typically depend on the resource, the "*" request is only useful as a "ping" or "no-op" 932 1004 type of method; it does nothing beyond allowing the client to test the capabilities of the server. For example, this can be 933 1005 used to test a proxy for HTTP/1.1 conformance (or lack thereof). 934 1006 </p> 935 <p id="rfc.section. 2.3.1.p.5">If the request-target is not an asterisk, the OPTIONS request applies only to the options that are available when communicating1007 <p id="rfc.section.3.3.1.p.5">If the request-target is not an asterisk, the OPTIONS request applies only to the options that are available when communicating 936 1008 with that resource. 937 1009 </p> 938 <p id="rfc.section. 2.3.1.p.6">A <a href="#status.200" class="smpl">200 (OK)</a> response <em class="bcp14">SHOULD</em> include any header fields that indicate optional features implemented by the server and applicable to that resource (e.g., <a href="#header.allow" class="smpl">Allow</a>), possibly including extensions not defined by this specification. The response body, if any, <em class="bcp14">SHOULD</em> also include information about the communication options. The format for such a body is not defined by this specification,1010 <p id="rfc.section.3.3.1.p.6">A <a href="#status.200" class="smpl">200 (OK)</a> response <em class="bcp14">SHOULD</em> include any header fields that indicate optional features implemented by the server and applicable to that resource (e.g., <a href="#header.allow" class="smpl">Allow</a>), possibly including extensions not defined by this specification. The response body, if any, <em class="bcp14">SHOULD</em> also include information about the communication options. The format for such a body is not defined by this specification, 939 1011 but might be defined by future extensions to HTTP. Content negotiation <em class="bcp14">MAY</em> be used to select the appropriate response format. If no response body is included, the response <em class="bcp14">MUST</em> include a <a href="p1-messaging.html#header.content-length" class="smpl">Content-Length</a> field with a field-value of "0". 940 1012 </p> 941 <p id="rfc.section. 2.3.1.p.7">The <a href="#header.max-forwards" class="smpl">Max-Forwards</a> header field <em class="bcp14">MAY</em> be used to target a specific proxy in the request chain (see <a href="#header.max-forwards" id="rfc.xref.header.max-forwards.1" title="Max-Forwards">Section 9.14</a>). If no Max-Forwards field is present in the request, then the forwarded request <em class="bcp14">MUST NOT</em> include a Max-Forwards field.942 </p> 943 <h3 id="rfc.section. 2.3.2"><a href="#rfc.section.2.3.2">2.3.2</a> <a id="GET" href="#GET">GET</a></h3>1013 <p id="rfc.section.3.3.1.p.7">The <a href="#header.max-forwards" class="smpl">Max-Forwards</a> header field <em class="bcp14">MAY</em> be used to target a specific proxy in the request chain (see <a href="#header.max-forwards" id="rfc.xref.header.max-forwards.1" title="Max-Forwards">Section 10.14</a>). If no Max-Forwards field is present in the request, then the forwarded request <em class="bcp14">MUST NOT</em> include a Max-Forwards field. 1014 </p> 1015 <h3 id="rfc.section.3.3.2"><a href="#rfc.section.3.3.2">3.3.2</a> <a id="GET" href="#GET">GET</a></h3> 944 1016 <div id="rfc.iref.g.2"></div> 945 1017 <div id="rfc.iref.m.2"></div> 946 <p id="rfc.section. 2.3.2.p.1">The GET method requests transfer of a current representation of the target resource.</p>947 <p id="rfc.section. 2.3.2.p.2">If the target resource is a data-producing process, it is the produced data which shall be returned as the representation1018 <p id="rfc.section.3.3.2.p.1">The GET method requests transfer of a current representation of the target resource.</p> 1019 <p id="rfc.section.3.3.2.p.2">If the target resource is a data-producing process, it is the produced data which shall be returned as the representation 948 1020 in the response and not the source text of the process, unless that text happens to be the output of the process. 949 1021 </p> 950 <p id="rfc.section. 2.3.2.p.3">The semantics of the GET method change to a "conditional GET" if the request message includes an <a href="p4-conditional.html#header.if-modified-since" class="smpl">If-Modified-Since</a>, <a href="p4-conditional.html#header.if-unmodified-since" class="smpl">If-Unmodified-Since</a>, <a href="p4-conditional.html#header.if-match" class="smpl">If-Match</a>, <a href="p4-conditional.html#header.if-none-match" class="smpl">If-None-Match</a>, or <a href="p5-range.html#header.if-range" class="smpl">If-Range</a> header field (<a href="#Part4" id="rfc.xref.Part4.1"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a>). A conditional GET requests that the representation be transferred only under the circumstances described by the conditional1022 <p id="rfc.section.3.3.2.p.3">The semantics of the GET method change to a "conditional GET" if the request message includes an <a href="p4-conditional.html#header.if-modified-since" class="smpl">If-Modified-Since</a>, <a href="p4-conditional.html#header.if-unmodified-since" class="smpl">If-Unmodified-Since</a>, <a href="p4-conditional.html#header.if-match" class="smpl">If-Match</a>, <a href="p4-conditional.html#header.if-none-match" class="smpl">If-None-Match</a>, or <a href="p5-range.html#header.if-range" class="smpl">If-Range</a> header field (<a href="#Part4" id="rfc.xref.Part4.1"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a>). A conditional GET requests that the representation be transferred only under the circumstances described by the conditional 951 1023 header field(s). The conditional GET request is intended to reduce unnecessary network usage by allowing cached representations 952 1024 to be refreshed without requiring multiple requests or transferring data already held by the client. 953 1025 </p> 954 <p id="rfc.section. 2.3.2.p.4">The semantics of the GET method change to a "partial GET" if the request message includes a <a href="p5-range.html#range.retrieval.requests" class="smpl">Range</a> header field (<a href="#Part5" id="rfc.xref.Part5.1"><cite title="HTTP/1.1, part 5: Range Requests">[Part5]</cite></a>). A partial GET requests that only part of the representation be transferred, as described in <a href="p5-range.html#header.range" title="Range">Section 5.4</a> of <a href="#Part5" id="rfc.xref.Part5.2"><cite title="HTTP/1.1, part 5: Range Requests">[Part5]</cite></a>. The partial GET request is intended to reduce unnecessary network usage by allowing partially-retrieved representations1026 <p id="rfc.section.3.3.2.p.4">The semantics of the GET method change to a "partial GET" if the request message includes a <a href="p5-range.html#range.retrieval.requests" class="smpl">Range</a> header field (<a href="#Part5" id="rfc.xref.Part5.1"><cite title="HTTP/1.1, part 5: Range Requests">[Part5]</cite></a>). A partial GET requests that only part of the representation be transferred, as described in <a href="p5-range.html#header.range" title="Range">Section 5.4</a> of <a href="#Part5" id="rfc.xref.Part5.2"><cite title="HTTP/1.1, part 5: Range Requests">[Part5]</cite></a>. The partial GET request is intended to reduce unnecessary network usage by allowing partially-retrieved representations 955 1027 to be completed without transferring data already held by the client. 956 1028 </p> 957 <p id="rfc.section. 2.3.2.p.5">Bodies on GET requests have no defined semantics. Note that sending a body on a GET request might cause some existing implementations1029 <p id="rfc.section.3.3.2.p.5">Bodies on GET requests have no defined semantics. Note that sending a body on a GET request might cause some existing implementations 958 1030 to reject the request. 959 1031 </p> 960 <p id="rfc.section. 2.3.2.p.6">The response to a GET request is cacheable and <em class="bcp14">MAY</em> be used to satisfy subsequent GET and HEAD requests (see <a href="#Part6" id="rfc.xref.Part6.2"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>).961 </p> 962 <p id="rfc.section. 2.3.2.p.7">See <a href="#encoding.sensitive.information.in.uris" title="Encoding Sensitive Information in URIs">Section 11.2</a> for security considerations when used for forms.963 </p> 964 <h3 id="rfc.section. 2.3.3"><a href="#rfc.section.2.3.3">2.3.3</a> <a id="HEAD" href="#HEAD">HEAD</a></h3>1032 <p id="rfc.section.3.3.2.p.6">The response to a GET request is cacheable and <em class="bcp14">MAY</em> be used to satisfy subsequent GET and HEAD requests (see <a href="#Part6" id="rfc.xref.Part6.2"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>). 1033 </p> 1034 <p id="rfc.section.3.3.2.p.7">See <a href="#encoding.sensitive.information.in.uris" title="Encoding Sensitive Information in URIs">Section 12.2</a> for security considerations when used for forms. 1035 </p> 1036 <h3 id="rfc.section.3.3.3"><a href="#rfc.section.3.3.3">3.3.3</a> <a id="HEAD" href="#HEAD">HEAD</a></h3> 965 1037 <div id="rfc.iref.h.1"></div> 966 1038 <div id="rfc.iref.m.3"></div> 967 <p id="rfc.section. 2.3.3.p.1">The HEAD method is identical to GET except that the server <em class="bcp14">MUST NOT</em> return a message body in the response. The metadata contained in the HTTP header fields in response to a HEAD request <em class="bcp14">SHOULD</em> be identical to the information sent in response to a GET request. This method can be used for obtaining metadata about the1039 <p id="rfc.section.3.3.3.p.1">The HEAD method is identical to GET except that the server <em class="bcp14">MUST NOT</em> return a message body in the response. The metadata contained in the HTTP header fields in response to a HEAD request <em class="bcp14">SHOULD</em> be identical to the information sent in response to a GET request. This method can be used for obtaining metadata about the 968 1040 representation implied by the request without transferring the representation body. This method is often used for testing 969 1041 hypertext links for validity, accessibility, and recent modification. 970 1042 </p> 971 <p id="rfc.section. 2.3.3.p.2">The response to a HEAD request is cacheable and <em class="bcp14">MAY</em> be used to satisfy a subsequent HEAD request. It also has potential side effects on previously stored responses to GET; see <a href="p6-cache.html#head.effects" title="Updating Caches with HEAD Responses">Section 5</a> of <a href="#Part6" id="rfc.xref.Part6.3"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>.972 </p> 973 <p id="rfc.section. 2.3.3.p.3">Bodies on HEAD requests have no defined semantics. Note that sending a body on a HEAD request might cause some existing implementations1043 <p id="rfc.section.3.3.3.p.2">The response to a HEAD request is cacheable and <em class="bcp14">MAY</em> be used to satisfy a subsequent HEAD request. It also has potential side effects on previously stored responses to GET; see <a href="p6-cache.html#head.effects" title="Updating Caches with HEAD Responses">Section 5</a> of <a href="#Part6" id="rfc.xref.Part6.3"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>. 1044 </p> 1045 <p id="rfc.section.3.3.3.p.3">Bodies on HEAD requests have no defined semantics. Note that sending a body on a HEAD request might cause some existing implementations 974 1046 to reject the request. 975 1047 </p> 976 1048 <div id="rfc.iref.p.1"></div> 977 1049 <div id="rfc.iref.m.4"></div> 978 <h3 id="rfc.section. 2.3.4"><a href="#rfc.section.2.3.4">2.3.4</a> <a id="POST" href="#POST">POST</a></h3>979 <p id="rfc.section. 2.3.4.p.1">The POST method requests that the origin server accept the representation enclosed in the request as data to be processed1050 <h3 id="rfc.section.3.3.4"><a href="#rfc.section.3.3.4">3.3.4</a> <a id="POST" href="#POST">POST</a></h3> 1051 <p id="rfc.section.3.3.4.p.1">The POST method requests that the origin server accept the representation enclosed in the request as data to be processed 980 1052 by the target resource. POST is designed to allow a uniform method to cover the following functions: 981 1053 </p> … … 986 1058 <li>Extending a database through an append operation.</li> 987 1059 </ul> 988 <p id="rfc.section. 2.3.4.p.2">The actual function performed by the POST method is determined by the server and is usually dependent on the effective request1060 <p id="rfc.section.3.3.4.p.2">The actual function performed by the POST method is determined by the server and is usually dependent on the effective request 989 1061 URI. 990 1062 </p> 991 <p id="rfc.section. 2.3.4.p.3">The action performed by the POST method might not result in a resource that can be identified by a URI. In this case, either <a href="#status.200" class="smpl">200 (OK)</a> or <a href="#status.204" class="smpl">204 (No Content)</a> is the appropriate response status code, depending on whether or not the response includes a representation that describes1063 <p id="rfc.section.3.3.4.p.3">The action performed by the POST method might not result in a resource that can be identified by a URI. In this case, either <a href="#status.200" class="smpl">200 (OK)</a> or <a href="#status.204" class="smpl">204 (No Content)</a> is the appropriate response status code, depending on whether or not the response includes a representation that describes 992 1064 the result. 993 1065 </p> 994 <p id="rfc.section. 2.3.4.p.4">If a resource has been created on the origin server, the response <em class="bcp14">SHOULD</em> be <a href="#status.201" class="smpl">201 (Created)</a> and contain a representation which describes the status of the request and refers to the new resource, and a <a href="#header.location" class="smpl">Location</a> header field (see <a href="#header.location" id="rfc.xref.header.location.1" title="Location">Section 9.13</a>).995 </p> 996 <p id="rfc.section. 2.3.4.p.5">Responses to POST requests are only cacheable when they include explicit freshness information (see <a href="p6-cache.html#calculating.freshness.lifetime" title="Calculating Freshness Lifetime">Section 4.1.1</a> of <a href="#Part6" id="rfc.xref.Part6.4"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>). A cached POST response with a <a href="#header.content-location" class="smpl">Content-Location</a> header field (see <a href="#header.content-location" id="rfc.xref.header.content-location.1" title="Content-Location">Section 9.8</a>) whose value is the effective Request URI <em class="bcp14">MAY</em> be used to satisfy subsequent GET and HEAD requests.997 </p> 998 <p id="rfc.section. 2.3.4.p.6">Note that POST caching is not widely implemented. However, the <a href="#status.303" class="smpl">303 (See Other)</a> response can be used to direct the user agent to retrieve a cacheable representation of the resource.999 </p> 1000 <h3 id="rfc.section. 2.3.5"><a href="#rfc.section.2.3.5">2.3.5</a> <a id="PUT" href="#PUT">PUT</a></h3>1066 <p id="rfc.section.3.3.4.p.4">If a resource has been created on the origin server, the response <em class="bcp14">SHOULD</em> be <a href="#status.201" class="smpl">201 (Created)</a> and contain a representation which describes the status of the request and refers to the new resource, and a <a href="#header.location" class="smpl">Location</a> header field (see <a href="#header.location" id="rfc.xref.header.location.1" title="Location">Section 10.13</a>). 1067 </p> 1068 <p id="rfc.section.3.3.4.p.5">Responses to POST requests are only cacheable when they include explicit freshness information (see <a href="p6-cache.html#calculating.freshness.lifetime" title="Calculating Freshness Lifetime">Section 4.1.1</a> of <a href="#Part6" id="rfc.xref.Part6.4"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>). A cached POST response with a <a href="#header.content-location" class="smpl">Content-Location</a> header field (see <a href="#header.content-location" id="rfc.xref.header.content-location.1" title="Content-Location">Section 10.8</a>) whose value is the effective Request URI <em class="bcp14">MAY</em> be used to satisfy subsequent GET and HEAD requests. 1069 </p> 1070 <p id="rfc.section.3.3.4.p.6">Note that POST caching is not widely implemented. However, the <a href="#status.303" class="smpl">303 (See Other)</a> response can be used to direct the user agent to retrieve a cacheable representation of the resource. 1071 </p> 1072 <h3 id="rfc.section.3.3.5"><a href="#rfc.section.3.3.5">3.3.5</a> <a id="PUT" href="#PUT">PUT</a></h3> 1001 1073 <div id="rfc.iref.p.2"></div> 1002 1074 <div id="rfc.iref.m.5"></div> 1003 <p id="rfc.section. 2.3.5.p.1">The PUT method requests that the state of the target resource be created or replaced with the state defined by the representation1075 <p id="rfc.section.3.3.5.p.1">The PUT method requests that the state of the target resource be created or replaced with the state defined by the representation 1004 1076 enclosed in the request message payload. A successful PUT of a given representation would suggest that a subsequent GET on 1005 1077 that same target resource will result in an equivalent representation being returned in a <a href="#status.200" class="smpl">200 (OK)</a> response. However, there is no guarantee that such a state change will be observable, since the target resource might be acted … … 1008 1080 by the origin server. 1009 1081 </p> 1010 <p id="rfc.section. 2.3.5.p.2">If the target resource does not have a current representation and the PUT successfully creates one, then the origin server <em class="bcp14">MUST</em> inform the user agent by sending a <a href="#status.201" class="smpl">201 (Created)</a> response. If the target resource does have a current representation and that representation is successfully modified in accordance1082 <p id="rfc.section.3.3.5.p.2">If the target resource does not have a current representation and the PUT successfully creates one, then the origin server <em class="bcp14">MUST</em> inform the user agent by sending a <a href="#status.201" class="smpl">201 (Created)</a> response. If the target resource does have a current representation and that representation is successfully modified in accordance 1011 1083 with the state of the enclosed representation, then either a <a href="#status.200" class="smpl">200 (OK)</a> or <a href="#status.204" class="smpl">204 (No Content)</a> response <em class="bcp14">SHOULD</em> be sent to indicate successful completion of the request. 1012 1084 </p> 1013 <p id="rfc.section. 2.3.5.p.3">Unrecognized header fields <em class="bcp14">SHOULD</em> be ignored (i.e., not saved as part of the resource state).1014 </p> 1015 <p id="rfc.section. 2.3.5.p.4">An origin server <em class="bcp14">SHOULD</em> verify that the PUT representation is consistent with any constraints which the server has for the target resource that cannot1085 <p id="rfc.section.3.3.5.p.3">Unrecognized header fields <em class="bcp14">SHOULD</em> be ignored (i.e., not saved as part of the resource state). 1086 </p> 1087 <p id="rfc.section.3.3.5.p.4">An origin server <em class="bcp14">SHOULD</em> verify that the PUT representation is consistent with any constraints which the server has for the target resource that cannot 1016 1088 or will not be changed by the PUT. This is particularly important when the origin server uses internal configuration information 1017 1089 related to the URI in order to set the values for representation metadata on GET responses. When a PUT representation is inconsistent … … 1019 1091 appropriate error message containing sufficient information to explain why the representation is unsuitable. The <a href="#status.409" class="smpl">409 (Conflict)</a> or <a href="#status.415" class="smpl">415 (Unsupported Media Type)</a> status codes are suggested, with the latter being specific to constraints on <a href="#header.content-type" class="smpl">Content-Type</a> values. 1020 1092 </p> 1021 <p id="rfc.section. 2.3.5.p.5">For example, if the target resource is configured to always have a <a href="#header.content-type" class="smpl">Content-Type</a> of "text/html" and the representation being PUT has a Content-Type of "image/jpeg", then the origin server <em class="bcp14">SHOULD</em> do one of:1093 <p id="rfc.section.3.3.5.p.5">For example, if the target resource is configured to always have a <a href="#header.content-type" class="smpl">Content-Type</a> of "text/html" and the representation being PUT has a Content-Type of "image/jpeg", then the origin server <em class="bcp14">SHOULD</em> do one of: 1022 1094 </p> 1023 1095 <ol class="la"> … … 1030 1102 </li> 1031 1103 </ol> 1032 <p id="rfc.section. 2.3.5.p.6">HTTP does not define exactly how a PUT method affects the state of an origin server beyond what can be expressed by the intent1104 <p id="rfc.section.3.3.5.p.6">HTTP does not define exactly how a PUT method affects the state of an origin server beyond what can be expressed by the intent 1033 1105 of the user agent request and the semantics of the origin server response. It does not define what a resource might be, in 1034 1106 any sense of that word, beyond the interface provided via HTTP. It does not define how resource state is "stored", nor how … … 1037 1109 the server. 1038 1110 </p> 1039 <p id="rfc.section. 2.3.5.p.7">The fundamental difference between the POST and PUT methods is highlighted by the different intent for the target resource.1111 <p id="rfc.section.3.3.5.p.7">The fundamental difference between the POST and PUT methods is highlighted by the different intent for the target resource. 1040 1112 The target resource in a POST request is intended to handle the enclosed representation as a data-accepting process, such 1041 1113 as for a gateway to some other protocol or a document that accepts annotations. In contrast, the target resource in a PUT … … 1043 1115 and visible to intermediaries, even though the exact effect is only known by the origin server. 1044 1116 </p> 1045 <p id="rfc.section. 2.3.5.p.8">Proper interpretation of a PUT request presumes that the user agent knows what target resource is desired. A service that1117 <p id="rfc.section.3.3.5.p.8">Proper interpretation of a PUT request presumes that the user agent knows what target resource is desired. A service that 1046 1118 is intended to select a proper URI on behalf of the client, after receiving a state-changing request, <em class="bcp14">SHOULD</em> be implemented using the POST method rather than PUT. If the origin server will not make the requested PUT state change to 1047 1119 the target resource and instead wishes to have it applied to a different resource, such as when the resource has been moved 1048 1120 to a different URI, then the origin server <em class="bcp14">MUST</em> send a <a href="#status.301" class="smpl">301 (Moved Permanently)</a> response; the user agent <em class="bcp14">MAY</em> then make its own decision regarding whether or not to redirect the request. 1049 1121 </p> 1050 <p id="rfc.section. 2.3.5.p.9">A PUT request applied to the target resource <em class="bcp14">MAY</em> have side-effects on other resources. For example, an article might have a URI for identifying "the current version" (a resource)1122 <p id="rfc.section.3.3.5.p.9">A PUT request applied to the target resource <em class="bcp14">MAY</em> have side-effects on other resources. For example, an article might have a URI for identifying "the current version" (a resource) 1051 1123 which is separate from the URIs identifying each particular version (different resources that at one point shared the same 1052 1124 state as the current version resource). A successful PUT request on "the current version" URI might therefore create a new … … 1054 1126 the related resources. 1055 1127 </p> 1056 <p id="rfc.section. 2.3.5.p.10">An origin server <em class="bcp14">SHOULD</em> reject any PUT request that contains a <a href="p5-range.html#header.content-range" class="smpl">Content-Range</a> header field (<a href="p5-range.html#header.content-range" title="Content-Range">Section 5.2</a> of <a href="#Part5" id="rfc.xref.Part5.3"><cite title="HTTP/1.1, part 5: Range Requests">[Part5]</cite></a>), since it might be misinterpreted as partial content (or might be partial content that is being mistakenly PUT as a full1128 <p id="rfc.section.3.3.5.p.10">An origin server <em class="bcp14">SHOULD</em> reject any PUT request that contains a <a href="p5-range.html#header.content-range" class="smpl">Content-Range</a> header field (<a href="p5-range.html#header.content-range" title="Content-Range">Section 5.2</a> of <a href="#Part5" id="rfc.xref.Part5.3"><cite title="HTTP/1.1, part 5: Range Requests">[Part5]</cite></a>), since it might be misinterpreted as partial content (or might be partial content that is being mistakenly PUT as a full 1057 1129 representation). Partial content updates are possible by targeting a separately identified resource with state that overlaps 1058 1130 a portion of the larger resource, or by using a different method that has been specifically defined for partial updates (for 1059 1131 example, the PATCH method defined in <a href="#RFC5789" id="rfc.xref.RFC5789.1"><cite title="PATCH Method for HTTP">[RFC5789]</cite></a>). 1060 1132 </p> 1061 <p id="rfc.section. 2.3.5.p.11">Responses to the PUT method are not cacheable. If a PUT request passes through a cache that has one or more stored responses1133 <p id="rfc.section.3.3.5.p.11">Responses to the PUT method are not cacheable. If a PUT request passes through a cache that has one or more stored responses 1062 1134 for the effective request URI, those stored responses will be invalidated (see <a href="p6-cache.html#invalidation.after.updates.or.deletions" title="Request Methods that Invalidate">Section 6</a> of <a href="#Part6" id="rfc.xref.Part6.5"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>). 1063 1135 </p> 1064 <h3 id="rfc.section. 2.3.6"><a href="#rfc.section.2.3.6">2.3.6</a> <a id="DELETE" href="#DELETE">DELETE</a></h3>1136 <h3 id="rfc.section.3.3.6"><a href="#rfc.section.3.3.6">3.3.6</a> <a id="DELETE" href="#DELETE">DELETE</a></h3> 1065 1137 <div id="rfc.iref.d.1"></div> 1066 1138 <div id="rfc.iref.m.6"></div> 1067 <p id="rfc.section. 2.3.6.p.1">The DELETE method requests that the origin server delete the target resource. This method <em class="bcp14">MAY</em> be overridden by human intervention (or other means) on the origin server. The client cannot be guaranteed that the operation1139 <p id="rfc.section.3.3.6.p.1">The DELETE method requests that the origin server delete the target resource. This method <em class="bcp14">MAY</em> be overridden by human intervention (or other means) on the origin server. The client cannot be guaranteed that the operation 1068 1140 has been carried out, even if the status code returned from the origin server indicates that the action has been completed 1069 1141 successfully. However, the server <em class="bcp14">SHOULD NOT</em> indicate success unless, at the time the response is given, it intends to delete the resource or move it to an inaccessible 1070 1142 location. 1071 1143 </p> 1072 <p id="rfc.section. 2.3.6.p.2">A successful response <em class="bcp14">SHOULD</em> be <a href="#status.200" class="smpl">200 (OK)</a> if the response includes a representation describing the status, <a href="#status.202" class="smpl">202 (Accepted)</a> if the action has not yet been enacted, or <a href="#status.204" class="smpl">204 (No Content)</a> if the action has been enacted but the response does not include a representation.1073 </p> 1074 <p id="rfc.section. 2.3.6.p.3">Bodies on DELETE requests have no defined semantics. Note that sending a body on a DELETE request might cause some existing1144 <p id="rfc.section.3.3.6.p.2">A successful response <em class="bcp14">SHOULD</em> be <a href="#status.200" class="smpl">200 (OK)</a> if the response includes a representation describing the status, <a href="#status.202" class="smpl">202 (Accepted)</a> if the action has not yet been enacted, or <a href="#status.204" class="smpl">204 (No Content)</a> if the action has been enacted but the response does not include a representation. 1145 </p> 1146 <p id="rfc.section.3.3.6.p.3">Bodies on DELETE requests have no defined semantics. Note that sending a body on a DELETE request might cause some existing 1075 1147 implementations to reject the request. 1076 1148 </p> 1077 <p id="rfc.section. 2.3.6.p.4">Responses to the DELETE method are not cacheable. If a DELETE request passes through a cache that has one or more stored responses1149 <p id="rfc.section.3.3.6.p.4">Responses to the DELETE method are not cacheable. If a DELETE request passes through a cache that has one or more stored responses 1078 1150 for the effective request URI, those stored responses will be invalidated (see <a href="p6-cache.html#invalidation.after.updates.or.deletions" title="Request Methods that Invalidate">Section 6</a> of <a href="#Part6" id="rfc.xref.Part6.6"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>). 1079 1151 </p> 1080 <h3 id="rfc.section. 2.3.7"><a href="#rfc.section.2.3.7">2.3.7</a> <a id="TRACE" href="#TRACE">TRACE</a></h3>1152 <h3 id="rfc.section.3.3.7"><a href="#rfc.section.3.3.7">3.3.7</a> <a id="TRACE" href="#TRACE">TRACE</a></h3> 1081 1153 <div id="rfc.iref.t.1"></div> 1082 1154 <div id="rfc.iref.m.7"></div> 1083 <p id="rfc.section. 2.3.7.p.1">The TRACE method requests a remote, application-layer loop-back of the request message. The final recipient of the request <em class="bcp14">SHOULD</em> reflect the message received back to the client as the message body of a <a href="#status.200" class="smpl">200 (OK)</a> response. The final recipient is either the origin server or the first proxy to receive a <a href="#header.max-forwards" class="smpl">Max-Forwards</a> value of zero (0) in the request (see <a href="#header.max-forwards" id="rfc.xref.header.max-forwards.2" title="Max-Forwards">Section 9.14</a>). A TRACE request <em class="bcp14">MUST NOT</em> include a message body.1084 </p> 1085 <p id="rfc.section. 2.3.7.p.2">TRACE allows the client to see what is being received at the other end of the request chain and use that data for testing1086 or diagnostic information. The value of the <a href="p1-messaging.html#header.via" class="smpl">Via</a> header field (<a href="p1-messaging.html#header.via" title="Via">Section 6.2</a> of <a href="#Part1" id="rfc.xref.Part1.7"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>) is of particular interest, since it acts as a trace of the request chain. Use of the <a href="#header.max-forwards" class="smpl">Max-Forwards</a> header field allows the client to limit the length of the request chain, which is useful for testing a chain of proxies forwarding1155 <p id="rfc.section.3.3.7.p.1">The TRACE method requests a remote, application-layer loop-back of the request message. The final recipient of the request <em class="bcp14">SHOULD</em> reflect the message received back to the client as the message body of a <a href="#status.200" class="smpl">200 (OK)</a> response. The final recipient is either the origin server or the first proxy to receive a <a href="#header.max-forwards" class="smpl">Max-Forwards</a> value of zero (0) in the request (see <a href="#header.max-forwards" id="rfc.xref.header.max-forwards.2" title="Max-Forwards">Section 10.14</a>). A TRACE request <em class="bcp14">MUST NOT</em> include a message body. 1156 </p> 1157 <p id="rfc.section.3.3.7.p.2">TRACE allows the client to see what is being received at the other end of the request chain and use that data for testing 1158 or diagnostic information. The value of the <a href="p1-messaging.html#header.via" class="smpl">Via</a> header field (<a href="p1-messaging.html#header.via" title="Via">Section 5.7</a> of <a href="#Part1" id="rfc.xref.Part1.9"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>) is of particular interest, since it acts as a trace of the request chain. Use of the <a href="#header.max-forwards" class="smpl">Max-Forwards</a> header field allows the client to limit the length of the request chain, which is useful for testing a chain of proxies forwarding 1087 1159 messages in an infinite loop. 1088 1160 </p> 1089 <p id="rfc.section. 2.3.7.p.3">If the request is valid, the response <em class="bcp14">SHOULD</em> have a <a href="#header.content-type" class="smpl">Content-Type</a> of "message/http" (see <a href="p1-messaging.html#internet.media.type.message.http" title="Internet Media Type message/http">Section 7.3.1</a> of <a href="#Part1" id="rfc.xref.Part1.8"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>) and contain a message body that encloses a copy of the entire request message. Responses to the TRACE method are not cacheable.1161 <p id="rfc.section.3.3.7.p.3">If the request is valid, the response <em class="bcp14">SHOULD</em> have a <a href="#header.content-type" class="smpl">Content-Type</a> of "message/http" (see <a href="p1-messaging.html#internet.media.type.message.http" title="Internet Media Type message/http">Section 7.3.1</a> of <a href="#Part1" id="rfc.xref.Part1.10"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>) and contain a message body that encloses a copy of the entire request message. Responses to the TRACE method are not cacheable. 1090 1162 </p> 1091 1163 <div id="rfc.iref.c.2"></div> 1092 1164 <div id="rfc.iref.m.8"></div> 1093 <h3 id="rfc.section. 2.3.8"><a href="#rfc.section.2.3.8">2.3.8</a> <a id="CONNECT" href="#CONNECT">CONNECT</a></h3>1094 <p id="rfc.section. 2.3.8.p.1">The CONNECT method requests that the proxy establish a tunnel to the request-target and, if successful, thereafter restrict1165 <h3 id="rfc.section.3.3.8"><a href="#rfc.section.3.3.8">3.3.8</a> <a id="CONNECT" href="#CONNECT">CONNECT</a></h3> 1166 <p id="rfc.section.3.3.8.p.1">The CONNECT method requests that the proxy establish a tunnel to the request-target and, if successful, thereafter restrict 1095 1167 its behavior to blind forwarding of packets until the connection is closed. 1096 1168 </p> 1097 <p id="rfc.section. 2.3.8.p.2">When using CONNECT, the request-target <em class="bcp14">MUST</em> use the authority form (<a href="p1-messaging.html#request-target" title="Request Target">Section 5.3</a> of <a href="#Part1" id="rfc.xref.Part1.9"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>); i.e., the request-target consists of only the host name and port number of the tunnel destination, separated by a colon.1169 <p id="rfc.section.3.3.8.p.2">When using CONNECT, the request-target <em class="bcp14">MUST</em> use the authority form (<a href="p1-messaging.html#request-target" title="Request Target">Section 5.3</a> of <a href="#Part1" id="rfc.xref.Part1.11"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>); i.e., the request-target consists of only the host name and port number of the tunnel destination, separated by a colon. 1098 1170 For example, 1099 1171 </p> … … 1101 1173 Host: server.example.com:80 1102 1174 1103 </pre><p id="rfc.section. 2.3.8.p.4">Any <a href="#status.2xx" class="smpl">2xx (Successful)</a> response to a CONNECT request indicates that the proxy has established a connection to the requested host and port, and has1175 </pre><p id="rfc.section.3.3.8.p.4">Any <a href="#status.2xx" class="smpl">2xx (Successful)</a> response to a CONNECT request indicates that the proxy has established a connection to the requested host and port, and has 1104 1176 switched to tunneling the current connection to that server connection. The tunneled data from the server begins immediately 1105 1177 after the blank line that concludes the successful response's header block. 1106 1178 </p> 1107 <p id="rfc.section. 2.3.8.p.5">A server <em class="bcp14">SHOULD NOT</em> send any <a href="p1-messaging.html#header.transfer-encoding" class="smpl">Transfer-Encoding</a> or <a href="p1-messaging.html#header.content-length" class="smpl">Content-Length</a> header fields in a successful response. A client <em class="bcp14">MUST</em> ignore any Content-Length or Transfer-Encoding header fields received in a successful response.1108 </p> 1109 <p id="rfc.section. 2.3.8.p.6">Any response other than a successful response indicates that the tunnel has not yet been formed and that the connection remains1179 <p id="rfc.section.3.3.8.p.5">A server <em class="bcp14">SHOULD NOT</em> send any <a href="p1-messaging.html#header.transfer-encoding" class="smpl">Transfer-Encoding</a> or <a href="p1-messaging.html#header.content-length" class="smpl">Content-Length</a> header fields in a successful response. A client <em class="bcp14">MUST</em> ignore any Content-Length or Transfer-Encoding header fields received in a successful response. 1180 </p> 1181 <p id="rfc.section.3.3.8.p.6">Any response other than a successful response indicates that the tunnel has not yet been formed and that the connection remains 1110 1182 governed by HTTP. 1111 1183 </p> 1112 <p id="rfc.section. 2.3.8.p.7">Proxy authentication might be used to establish the authority to create a tunnel:</p>1184 <p id="rfc.section.3.3.8.p.7">Proxy authentication might be used to establish the authority to create a tunnel:</p> 1113 1185 <div id="rfc.figure.u.3"></div><pre class="text2">CONNECT server.example.com:80 HTTP/1.1 1114 1186 Host: server.example.com:80 1115 1187 Proxy-Authorization: basic aGVsbG86d29ybGQ= 1116 1188 1117 </pre><p id="rfc.section. 2.3.8.p.9">A message body on a CONNECT request has no defined semantics. Sending a body on a CONNECT request might cause existing implementations1189 </pre><p id="rfc.section.3.3.8.p.9">A message body on a CONNECT request has no defined semantics. Sending a body on a CONNECT request might cause existing implementations 1118 1190 to reject the request. 1119 1191 </p> 1120 <p id="rfc.section. 2.3.8.p.10">Similar to a pipelined HTTP/1.1 request, data to be tunneled from client to server <em class="bcp14">MAY</em> be sent immediately after the request (before a response is received). The usual caveats also apply: data can be discarded1192 <p id="rfc.section.3.3.8.p.10">Similar to a pipelined HTTP/1.1 request, data to be tunneled from client to server <em class="bcp14">MAY</em> be sent immediately after the request (before a response is received). The usual caveats also apply: data can be discarded 1121 1193 if the eventual response is negative, and the connection can be reset with no response if more than one TCP segment is outstanding. 1122 1194 </p> 1123 <p id="rfc.section. 2.3.8.p.11">It might be the case that the proxy itself can only reach the requested origin server through another proxy. In this case,1195 <p id="rfc.section.3.3.8.p.11">It might be the case that the proxy itself can only reach the requested origin server through another proxy. In this case, 1124 1196 the first proxy <em class="bcp14">SHOULD</em> make a CONNECT request of that next proxy, requesting a tunnel to the authority. A proxy <em class="bcp14">MUST NOT</em> respond with any <a href="#status.2xx" class="smpl">2xx</a> status code unless it has either a direct or tunnel connection established to the authority. 1125 1197 </p> 1126 <p id="rfc.section. 2.3.8.p.12">If at any point either one of the peers gets disconnected, any outstanding data that came from that peer will be passed to1198 <p id="rfc.section.3.3.8.p.12">If at any point either one of the peers gets disconnected, any outstanding data that came from that peer will be passed to 1127 1199 the other one, and after that also the other connection will be terminated by the proxy. If there is outstanding data to that 1128 1200 peer undelivered, that data will be discarded. 1129 1201 </p> 1130 <p id="rfc.section.2.3.8.p.13">An origin server which receives a CONNECT request for itself <em class="bcp14">MAY</em> respond with a <a href="#status.2xx" class="smpl">2xx</a> status code to indicate that a connection is established. However, most origin servers do not implement CONNECT. 1131 </p> 1132 <h1 id="rfc.section.3"><a href="#rfc.section.3">3.</a> <a id="header.fields" href="#header.fields">Header Fields</a></h1> 1133 <p id="rfc.section.3.p.1">Header fields are key value pairs that can be used to communicate data about the message, its payload, the target resource, 1134 or about the connection itself (i.e., control data). See <a href="p1-messaging.html#header.fields" title="Header Fields">Section 3.2</a> of <a href="#Part1" id="rfc.xref.Part1.10"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a> for a general definition of their syntax. 1135 </p> 1136 <h2 id="rfc.section.3.1"><a href="#rfc.section.3.1">3.1</a> <a id="considerations.for.creating.header.fields" href="#considerations.for.creating.header.fields">Considerations for Creating Header Fields</a></h2> 1137 <p id="rfc.section.3.1.p.1">New header fields are registered using the procedures described in <a href="#RFC3864" id="rfc.xref.RFC3864.1"><cite title="Registration Procedures for Message Header Fields">[RFC3864]</cite></a>. 1138 </p> 1139 <p id="rfc.section.3.1.p.2">The requirements for header field names are defined in <a href="http://tools.ietf.org/html/rfc3864#section-4.1">Section 4.1</a> of <a href="#RFC3864" id="rfc.xref.RFC3864.2"><cite title="Registration Procedures for Message Header Fields">[RFC3864]</cite></a>. Authors of specifications defining new fields are advised to keep the name as short as practical, and not to prefix them 1202 <p id="rfc.section.3.3.8.p.13">An origin server which receives a CONNECT request for itself <em class="bcp14">MAY</em> respond with a <a href="#status.2xx" class="smpl">2xx</a> status code to indicate that a connection is established. However, most origin servers do not implement CONNECT. 1203 </p> 1204 <h1 id="rfc.section.4"><a href="#rfc.section.4">4.</a> <a id="header.fields" href="#header.fields">Header Fields</a></h1> 1205 <p id="rfc.section.4.p.1">Header fields are key value pairs that can be used to communicate data about the message, its payload, the target resource, 1206 or about the connection itself (i.e., control data). See <a href="p1-messaging.html#header.fields" title="Header Fields">Section 3.2</a> of <a href="#Part1" id="rfc.xref.Part1.12"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a> for a general definition of their syntax. 1207 </p> 1208 <h2 id="rfc.section.4.1"><a href="#rfc.section.4.1">4.1</a> <a id="request.fields" href="#request.fields">Request-modifier Header Fields</a></h2> 1209 <h2 id="rfc.section.4.2"><a href="#rfc.section.4.2">4.2</a> <a id="response.fields" href="#response.fields">Status-modifier Header Fields</a></h2> 1210 <h2 id="rfc.section.4.3"><a href="#rfc.section.4.3">4.3</a> <a id="resource.fields" href="#resource.fields">Resource Metadata Fields</a></h2> 1211 <h2 id="rfc.section.4.4"><a href="#rfc.section.4.4">4.4</a> <a id="payload.fields" href="#payload.fields">Payload Metadata Fields</a></h2> 1212 <h2 id="rfc.section.4.5"><a href="#rfc.section.4.5">4.5</a> <a id="considerations.for.creating.header.fields" href="#considerations.for.creating.header.fields">Considerations for Creating Header Fields</a></h2> 1213 <p id="rfc.section.4.5.p.1">New header fields are registered using the procedures described in <a href="#RFC3864" id="rfc.xref.RFC3864.1"><cite title="Registration Procedures for Message Header Fields">[RFC3864]</cite></a>. 1214 </p> 1215 <p id="rfc.section.4.5.p.2">The requirements for header field names are defined in <a href="http://tools.ietf.org/html/rfc3864#section-4.1">Section 4.1</a> of <a href="#RFC3864" id="rfc.xref.RFC3864.2"><cite title="Registration Procedures for Message Header Fields">[RFC3864]</cite></a>. Authors of specifications defining new fields are advised to keep the name as short as practical, and not to prefix them 1140 1216 with "X-" if they are to be registered (either immediately or in the future). 1141 1217 </p> 1142 <p id="rfc.section. 3.1.p.3">New header field values typically have their syntax defined using ABNF (<a href="#RFC5234" id="rfc.xref.RFC5234.2"><cite title="Augmented BNF for Syntax Specifications: ABNF">[RFC5234]</cite></a>), using the extension defined in <a href="p1-messaging.html#abnf.extension" title="ABNF list extension: #rule">Appendix B</a> of <a href="#Part1" id="rfc.xref.Part1.11"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a> as necessary, and are usually constrained to the range of ASCII characters. Header fields needing a greater range of characters1218 <p id="rfc.section.4.5.p.3">New header field values typically have their syntax defined using ABNF (<a href="#RFC5234" id="rfc.xref.RFC5234.2"><cite title="Augmented BNF for Syntax Specifications: ABNF">[RFC5234]</cite></a>), using the extension defined in <a href="p1-messaging.html#abnf.extension" title="ABNF list extension: #rule">Appendix B</a> of <a href="#Part1" id="rfc.xref.Part1.13"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a> as necessary, and are usually constrained to the range of ASCII characters. Header fields needing a greater range of characters 1143 1219 can use an encoding such as the one defined in <a href="#RFC5987" id="rfc.xref.RFC5987.1"><cite title="Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters">[RFC5987]</cite></a>. 1144 1220 </p> 1145 <p id="rfc.section. 3.1.p.4">Because commas (",") are used as a generic delimiter between field-values, they need to be treated with care if they are allowed1221 <p id="rfc.section.4.5.p.4">Because commas (",") are used as a generic delimiter between field-values, they need to be treated with care if they are allowed 1146 1222 in the field-value's payload. Typically, components that might contain a comma are protected with double-quotes using the 1147 quoted-string ABNF production (<a href="p1-messaging.html#field.components" title="Field value components">Section 3.2.4</a> of <a href="#Part1" id="rfc.xref.Part1.1 2"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>).1148 </p> 1149 <p id="rfc.section. 3.1.p.5">For example, a textual date and a URI (either of which might contain a comma) could be safely carried in field-values like1223 quoted-string ABNF production (<a href="p1-messaging.html#field.components" title="Field value components">Section 3.2.4</a> of <a href="#Part1" id="rfc.xref.Part1.14"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>). 1224 </p> 1225 <p id="rfc.section.4.5.p.5">For example, a textual date and a URI (either of which might contain a comma) could be safely carried in field-values like 1150 1226 these: 1151 1227 </p> … … 1153 1229 "http://without-a-comma.example.com/" 1154 1230 Example-Date-Field: "Sat, 04 May 1996", "Wed, 14 Sep 2005" 1155 </pre><p id="rfc.section. 3.1.p.7">Note that double quote delimiters almost always are used with the quoted-string production; using a different syntax inside1231 </pre><p id="rfc.section.4.5.p.7">Note that double quote delimiters almost always are used with the quoted-string production; using a different syntax inside 1156 1232 double quotes will likely cause unnecessary confusion. 1157 1233 </p> 1158 <p id="rfc.section. 3.1.p.8">Many header fields use a format including (case-insensitively) named parameters (for instance, <a href="#header.content-type" class="smpl">Content-Type</a>, defined in <a href="#header.content-type" id="rfc.xref.header.content-type.1" title="Content-Type">Section 9.9</a>). Allowing both unquoted (token) and quoted (quoted-string) syntax for the parameter value enables recipients to use existing1234 <p id="rfc.section.4.5.p.8">Many header fields use a format including (case-insensitively) named parameters (for instance, <a href="#header.content-type" class="smpl">Content-Type</a>, defined in <a href="#header.content-type" id="rfc.xref.header.content-type.1" title="Content-Type">Section 10.9</a>). Allowing both unquoted (token) and quoted (quoted-string) syntax for the parameter value enables recipients to use existing 1159 1235 parser components. When allowing both forms, the meaning of a parameter value ought to be independent of the syntax used for 1160 it (for an example, see the notes on parameter handling for media types in <a href="#media.types" title="Media Types">Section 5.5</a>).1161 </p> 1162 <p id="rfc.section. 3.1.p.9">Authors of specifications defining new header fields are advised to consider documenting: </p>1236 it (for an example, see the notes on parameter handling for media types in <a href="#media.types" title="Media Types">Section 6.5</a>). 1237 </p> 1238 <p id="rfc.section.4.5.p.9">Authors of specifications defining new header fields are advised to consider documenting: </p> 1163 1239 <ul> 1164 1240 <li> 1165 <p>Whether the field is a single value, or whether it can be a list (delimited by commas; see <a href="p1-messaging.html#header.fields" title="Header Fields">Section 3.2</a> of <a href="#Part1" id="rfc.xref.Part1.1 3"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>).1241 <p>Whether the field is a single value, or whether it can be a list (delimited by commas; see <a href="p1-messaging.html#header.fields" title="Header Fields">Section 3.2</a> of <a href="#Part1" id="rfc.xref.Part1.15"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>). 1166 1242 </p> 1167 1243 <p>If it does not use the list syntax, document how to treat messages where the header field occurs multiple times (a sensible … … 1179 1255 </li> 1180 1256 <li> 1181 <p>Whether it is appropriate to list the field-name in the <a href="p1-messaging.html#header.connection" class="smpl">Connection</a> header field (i.e., if the header field is to be hop-by-hop, see <a href="p1-messaging.html#header.connection" title="Connection">Section 6.1</a> of <a href="#Part1" id="rfc.xref.Part1.1 4"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>).1257 <p>Whether it is appropriate to list the field-name in the <a href="p1-messaging.html#header.connection" class="smpl">Connection</a> header field (i.e., if the header field is to be hop-by-hop, see <a href="p1-messaging.html#header.connection" title="Connection">Section 6.1</a> of <a href="#Part1" id="rfc.xref.Part1.16"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>). 1182 1258 </p> 1183 1259 </li> … … 1190 1266 </li> 1191 1267 <li> 1192 <p>Whether the header field is useful or allowable in trailers (see <a href="p1-messaging.html#chunked.encoding" title="Chunked Transfer Coding">Section 4.1</a> of <a href="#Part1" id="rfc.xref.Part1.1 5"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>).1268 <p>Whether the header field is useful or allowable in trailers (see <a href="p1-messaging.html#chunked.encoding" title="Chunked Transfer Coding">Section 4.1</a> of <a href="#Part1" id="rfc.xref.Part1.17"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>). 1193 1269 </p> 1194 1270 </li> … … 1197 1273 </li> 1198 1274 </ul> 1199 <h2 id="rfc.section. 3.2"><a href="#rfc.section.3.2">3.2</a> <a id="request.header.fields" href="#request.header.fields">Request Header Fields</a></h2>1200 <p id="rfc.section. 3.2.p.1">The request header fields allow the client to pass additional information about the request, and about the client itself,1275 <h2 id="rfc.section.4.6"><a href="#rfc.section.4.6">4.6</a> <a id="request.header.fields" href="#request.header.fields">Request Header Fields</a></h2> 1276 <p id="rfc.section.4.6.p.1">The request header fields allow the client to pass additional information about the request, and about the client itself, 1201 1277 to the server. These fields act as request modifiers, with semantics equivalent to the parameters on a programming language 1202 1278 method invocation. … … 1213 1289 <tr> 1214 1290 <td class="left">Accept</td> 1215 <td class="left"><a href="#header.accept" id="rfc.xref.header.accept.1" title="Accept">Section 9.1</a></td>1291 <td class="left"><a href="#header.accept" id="rfc.xref.header.accept.1" title="Accept">Section 10.1</a></td> 1216 1292 </tr> 1217 1293 <tr> 1218 1294 <td class="left">Accept-Charset</td> 1219 <td class="left"><a href="#header.accept-charset" id="rfc.xref.header.accept-charset.1" title="Accept-Charset">Section 9.2</a></td>1295 <td class="left"><a href="#header.accept-charset" id="rfc.xref.header.accept-charset.1" title="Accept-Charset">Section 10.2</a></td> 1220 1296 </tr> 1221 1297 <tr> 1222 1298 <td class="left">Accept-Encoding</td> 1223 <td class="left"><a href="#header.accept-encoding" id="rfc.xref.header.accept-encoding.1" title="Accept-Encoding">Section 9.3</a></td>1299 <td class="left"><a href="#header.accept-encoding" id="rfc.xref.header.accept-encoding.1" title="Accept-Encoding">Section 10.3</a></td> 1224 1300 </tr> 1225 1301 <tr> 1226 1302 <td class="left">Accept-Language</td> 1227 <td class="left"><a href="#header.accept-language" id="rfc.xref.header.accept-language.1" title="Accept-Language">Section 9.4</a></td>1303 <td class="left"><a href="#header.accept-language" id="rfc.xref.header.accept-language.1" title="Accept-Language">Section 10.4</a></td> 1228 1304 </tr> 1229 1305 <tr> … … 1233 1309 <tr> 1234 1310 <td class="left">Expect</td> 1235 <td class="left"><a href="#header.expect" id="rfc.xref.header.expect.1" title="Expect">Section 9.11</a></td>1311 <td class="left"><a href="#header.expect" id="rfc.xref.header.expect.1" title="Expect">Section 10.11</a></td> 1236 1312 </tr> 1237 1313 <tr> 1238 1314 <td class="left">From</td> 1239 <td class="left"><a href="#header.from" id="rfc.xref.header.from.1" title="From">Section 9.12</a></td>1315 <td class="left"><a href="#header.from" id="rfc.xref.header.from.1" title="From">Section 10.12</a></td> 1240 1316 </tr> 1241 1317 <tr> 1242 1318 <td class="left">Host</td> 1243 <td class="left"><a href="p1-messaging.html#header.host" title="Host">Section 5.4</a> of <a href="#Part1" id="rfc.xref.Part1.1 6"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a></td>1319 <td class="left"><a href="p1-messaging.html#header.host" title="Host">Section 5.4</a> of <a href="#Part1" id="rfc.xref.Part1.18"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a></td> 1244 1320 </tr> 1245 1321 <tr> … … 1265 1341 <tr> 1266 1342 <td class="left">Max-Forwards</td> 1267 <td class="left"><a href="#header.max-forwards" id="rfc.xref.header.max-forwards.3" title="Max-Forwards">Section 9.14</a></td>1343 <td class="left"><a href="#header.max-forwards" id="rfc.xref.header.max-forwards.3" title="Max-Forwards">Section 10.14</a></td> 1268 1344 </tr> 1269 1345 <tr> … … 1277 1353 <tr> 1278 1354 <td class="left">Referer</td> 1279 <td class="left"><a href="#header.referer" id="rfc.xref.header.referer.1" title="Referer">Section 9.15</a></td>1355 <td class="left"><a href="#header.referer" id="rfc.xref.header.referer.1" title="Referer">Section 10.15</a></td> 1280 1356 </tr> 1281 1357 <tr> 1282 1358 <td class="left">TE</td> 1283 <td class="left"><a href="p1-messaging.html#header.te" title="TE">Section 4.3</a> of <a href="#Part1" id="rfc.xref.Part1.1 7"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a></td>1359 <td class="left"><a href="p1-messaging.html#header.te" title="TE">Section 4.3</a> of <a href="#Part1" id="rfc.xref.Part1.19"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a></td> 1284 1360 </tr> 1285 1361 <tr> 1286 1362 <td class="left">User-Agent</td> 1287 <td class="left"><a href="#header.user-agent" id="rfc.xref.header.user-agent.1" title="User-Agent">Section 9.18</a></td>1363 <td class="left"><a href="#header.user-agent" id="rfc.xref.header.user-agent.1" title="User-Agent">Section 10.18</a></td> 1288 1364 </tr> 1289 1365 </tbody> 1290 1366 </table> 1291 1367 </div> 1292 <h2 id="rfc.section. 3.3"><a href="#rfc.section.3.3">3.3</a> <a id="response.header.fields" href="#response.header.fields">Response Header Fields</a></h2>1293 <p id="rfc.section. 3.3.p.1">The response header fields allow the server to pass additional information about the response which cannot be placed in the1294 status-line. These header fields give information about the server and about further access to the target resource (<a href="p1-messaging.html#effective.request.uri" title="Effective Request URI">Section 5.5</a> of <a href="#Part1" id="rfc.xref.Part1. 18"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>).1368 <h2 id="rfc.section.4.7"><a href="#rfc.section.4.7">4.7</a> <a id="response.header.fields" href="#response.header.fields">Response Header Fields</a></h2> 1369 <p id="rfc.section.4.7.p.1">The response header fields allow the server to pass additional information about the response which cannot be placed in the 1370 status-line. These header fields give information about the server and about further access to the target resource (<a href="p1-messaging.html#effective.request.uri" title="Effective Request URI">Section 5.5</a> of <a href="#Part1" id="rfc.xref.Part1.20"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>). 1295 1371 </p> 1296 1372 <div id="rfc.table.u.2"> … … 1313 1389 <tr> 1314 1390 <td class="left">Allow</td> 1315 <td class="left"><a href="#header.allow" id="rfc.xref.header.allow.2" title="Allow">Section 9.5</a></td>1391 <td class="left"><a href="#header.allow" id="rfc.xref.header.allow.2" title="Allow">Section 10.5</a></td> 1316 1392 </tr> 1317 1393 <tr> 1318 1394 <td class="left">Date</td> 1319 <td class="left"><a href="#header.date" id="rfc.xref.header.date.1" title="Date">Section 9.10</a></td>1395 <td class="left"><a href="#header.date" id="rfc.xref.header.date.1" title="Date">Section 10.10</a></td> 1320 1396 </tr> 1321 1397 <tr> … … 1325 1401 <tr> 1326 1402 <td class="left">Location</td> 1327 <td class="left"><a href="#header.location" id="rfc.xref.header.location.2" title="Location">Section 9.13</a></td>1403 <td class="left"><a href="#header.location" id="rfc.xref.header.location.2" title="Location">Section 10.13</a></td> 1328 1404 </tr> 1329 1405 <tr> … … 1333 1409 <tr> 1334 1410 <td class="left">Retry-After</td> 1335 <td class="left"><a href="#header.retry-after" id="rfc.xref.header.retry-after.1" title="Retry-After">Section 9.16</a></td>1411 <td class="left"><a href="#header.retry-after" id="rfc.xref.header.retry-after.1" title="Retry-After">Section 10.16</a></td> 1336 1412 </tr> 1337 1413 <tr> 1338 1414 <td class="left">Server</td> 1339 <td class="left"><a href="#header.server" id="rfc.xref.header.server.1" title="Server">Section 9.17</a></td>1415 <td class="left"><a href="#header.server" id="rfc.xref.header.server.1" title="Server">Section 10.17</a></td> 1340 1416 </tr> 1341 1417 <tr> … … 1350 1426 </table> 1351 1427 </div> 1352 <h1 id="rfc.section. 4"><a href="#rfc.section.4">4.</a> <a id="status.codes" href="#status.codes">Status Codes</a></h1>1353 <p id="rfc.section. 4.p.1">The status-code element is a 3-digit integer result code of the attempt to understand and satisfy the request.</p>1354 <p id="rfc.section. 4.p.2">HTTP status codes are extensible. HTTP applications are not required to understand the meaning of all registered status codes,1428 <h1 id="rfc.section.5"><a href="#rfc.section.5">5.</a> <a id="status.codes" href="#status.codes">Response Status Codes</a></h1> 1429 <p id="rfc.section.5.p.1">The status-code element is a 3-digit integer result code of the attempt to understand and satisfy the request.</p> 1430 <p id="rfc.section.5.p.2">HTTP status codes are extensible. HTTP applications are not required to understand the meaning of all registered status codes, 1355 1431 though such understanding is obviously desirable. However, applications <em class="bcp14">MUST</em> understand the class of any status code, as indicated by the first digit, and treat any unrecognized response as being equivalent 1356 1432 to the x00 status code of that class, with the exception that an unrecognized response <em class="bcp14">MUST NOT</em> be cached. For example, if an unrecognized status code of 431 is received by the client, it can safely assume that there was … … 1358 1434 information which will explain the unusual status. 1359 1435 </p> 1360 <p id="rfc.section. 4.p.3">The first digit of the status-code defines the class of response. The last two digits do not have any categorization role.1436 <p id="rfc.section.5.p.3">The first digit of the status-code defines the class of response. The last two digits do not have any categorization role. 1361 1437 There are 5 values for the first digit: 1362 1438 </p> … … 1373 1449 </li> 1374 1450 </ul> 1375 <p id="rfc.section. 4.p.4">For most status codes the response can carry a payload, in which case a <a href="#header.content-type" class="smpl">Content-Type</a> header field indicates the payload's media type (<a href="#header.content-type" id="rfc.xref.header.content-type.2" title="Content-Type">Section 9.9</a>).1376 </p> 1377 <h2 id="rfc.section. 4.1"><a href="#rfc.section.4.1">4.1</a> <a id="overview.of.status.codes" href="#overview.of.status.codes">Overview of Status Codes</a></h2>1378 <p id="rfc.section. 4.1.p.1">The status codes listed below are defined in this specification, <a href="p4-conditional.html#status.code.definitions" title="Status Code Definitions">Section 4</a> of <a href="#Part4" id="rfc.xref.Part4.7"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a>, <a href="p5-range.html#status.code.definitions" title="Status Code Definitions">Section 3</a> of <a href="#Part5" id="rfc.xref.Part5.7"><cite title="HTTP/1.1, part 5: Range Requests">[Part5]</cite></a>, and <a href="p7-auth.html#status.code.definitions" title="Status Code Definitions">Section 3</a> of <a href="#Part7" id="rfc.xref.Part7.5"><cite title="HTTP/1.1, part 7: Authentication">[Part7]</cite></a>. The reason phrases listed here are only recommendations — they can be replaced by local equivalents without affecting the1451 <p id="rfc.section.5.p.4">For most status codes the response can carry a payload, in which case a <a href="#header.content-type" class="smpl">Content-Type</a> header field indicates the payload's media type (<a href="#header.content-type" id="rfc.xref.header.content-type.2" title="Content-Type">Section 10.9</a>). 1452 </p> 1453 <h2 id="rfc.section.5.1"><a href="#rfc.section.5.1">5.1</a> <a id="overview.of.status.codes" href="#overview.of.status.codes">Overview of Status Codes</a></h2> 1454 <p id="rfc.section.5.1.p.1">The status codes listed below are defined in this specification, <a href="p4-conditional.html#status.code.definitions" title="Status Code Definitions">Section 4</a> of <a href="#Part4" id="rfc.xref.Part4.7"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a>, <a href="p5-range.html#status.code.definitions" title="Status Code Definitions">Section 3</a> of <a href="#Part5" id="rfc.xref.Part5.7"><cite title="HTTP/1.1, part 5: Range Requests">[Part5]</cite></a>, and <a href="p7-auth.html#status.code.definitions" title="Status Code Definitions">Section 3</a> of <a href="#Part7" id="rfc.xref.Part7.5"><cite title="HTTP/1.1, part 7: Authentication">[Part7]</cite></a>. The reason phrases listed here are only recommendations — they can be replaced by local equivalents without affecting the 1379 1455 protocol. 1380 1456 </p> … … 1392 1468 <td class="left">100</td> 1393 1469 <td class="left">Continue</td> 1394 <td class="left"><a href="#status.100" id="rfc.xref.status.100.1" title="100 Continue">Section 4.3.1</a></td>1470 <td class="left"><a href="#status.100" id="rfc.xref.status.100.1" title="100 Continue">Section 5.3.1</a></td> 1395 1471 </tr> 1396 1472 <tr> 1397 1473 <td class="left">101</td> 1398 1474 <td class="left">Switching Protocols</td> 1399 <td class="left"><a href="#status.101" id="rfc.xref.status.101.1" title="101 Switching Protocols">Section 4.3.2</a></td>1475 <td class="left"><a href="#status.101" id="rfc.xref.status.101.1" title="101 Switching Protocols">Section 5.3.2</a></td> 1400 1476 </tr> 1401 1477 <tr> 1402 1478 <td class="left">200</td> 1403 1479 <td class="left">OK</td> 1404 <td class="left"><a href="#status.200" id="rfc.xref.status.200.1" title="200 OK">Section 4.4.1</a></td>1480 <td class="left"><a href="#status.200" id="rfc.xref.status.200.1" title="200 OK">Section 5.4.1</a></td> 1405 1481 </tr> 1406 1482 <tr> 1407 1483 <td class="left">201</td> 1408 1484 <td class="left">Created</td> 1409 <td class="left"><a href="#status.201" id="rfc.xref.status.201.1" title="201 Created">Section 4.4.2</a></td>1485 <td class="left"><a href="#status.201" id="rfc.xref.status.201.1" title="201 Created">Section 5.4.2</a></td> 1410 1486 </tr> 1411 1487 <tr> 1412 1488 <td class="left">202</td> 1413 1489 <td class="left">Accepted</td> 1414 <td class="left"><a href="#status.202" id="rfc.xref.status.202.1" title="202 Accepted">Section 4.4.3</a></td>1490 <td class="left"><a href="#status.202" id="rfc.xref.status.202.1" title="202 Accepted">Section 5.4.3</a></td> 1415 1491 </tr> 1416 1492 <tr> 1417 1493 <td class="left">203</td> 1418 1494 <td class="left">Non-Authoritative Information</td> 1419 <td class="left"><a href="#status.203" id="rfc.xref.status.203.1" title="203 Non-Authoritative Information">Section 4.4.4</a></td>1495 <td class="left"><a href="#status.203" id="rfc.xref.status.203.1" title="203 Non-Authoritative Information">Section 5.4.4</a></td> 1420 1496 </tr> 1421 1497 <tr> 1422 1498 <td class="left">204</td> 1423 1499 <td class="left">No Content</td> 1424 <td class="left"><a href="#status.204" id="rfc.xref.status.204.1" title="204 No Content">Section 4.4.5</a></td>1500 <td class="left"><a href="#status.204" id="rfc.xref.status.204.1" title="204 No Content">Section 5.4.5</a></td> 1425 1501 </tr> 1426 1502 <tr> 1427 1503 <td class="left">205</td> 1428 1504 <td class="left">Reset Content</td> 1429 <td class="left"><a href="#status.205" id="rfc.xref.status.205.1" title="205 Reset Content">Section 4.4.6</a></td>1505 <td class="left"><a href="#status.205" id="rfc.xref.status.205.1" title="205 Reset Content">Section 5.4.6</a></td> 1430 1506 </tr> 1431 1507 <tr> … … 1437 1513 <td class="left">300</td> 1438 1514 <td class="left">Multiple Choices</td> 1439 <td class="left"><a href="#status.300" id="rfc.xref.status.300.1" title="300 Multiple Choices">Section 4.5.1</a></td>1515 <td class="left"><a href="#status.300" id="rfc.xref.status.300.1" title="300 Multiple Choices">Section 5.5.1</a></td> 1440 1516 </tr> 1441 1517 <tr> 1442 1518 <td class="left">301</td> 1443 1519 <td class="left">Moved Permanently</td> 1444 <td class="left"><a href="#status.301" id="rfc.xref.status.301.1" title="301 Moved Permanently">Section 4.5.2</a></td>1520 <td class="left"><a href="#status.301" id="rfc.xref.status.301.1" title="301 Moved Permanently">Section 5.5.2</a></td> 1445 1521 </tr> 1446 1522 <tr> 1447 1523 <td class="left">302</td> 1448 1524 <td class="left">Found</td> 1449 <td class="left"><a href="#status.302" id="rfc.xref.status.302.1" title="302 Found">Section 4.5.3</a></td>1525 <td class="left"><a href="#status.302" id="rfc.xref.status.302.1" title="302 Found">Section 5.5.3</a></td> 1450 1526 </tr> 1451 1527 <tr> 1452 1528 <td class="left">303</td> 1453 1529 <td class="left">See Other</td> 1454 <td class="left"><a href="#status.303" id="rfc.xref.status.303.1" title="303 See Other">Section 4.5.4</a></td>1530 <td class="left"><a href="#status.303" id="rfc.xref.status.303.1" title="303 See Other">Section 5.5.4</a></td> 1455 1531 </tr> 1456 1532 <tr> … … 1462 1538 <td class="left">305</td> 1463 1539 <td class="left">Use Proxy</td> 1464 <td class="left"><a href="#status.305" id="rfc.xref.status.305.1" title="305 Use Proxy">Section 4.5.5</a></td>1540 <td class="left"><a href="#status.305" id="rfc.xref.status.305.1" title="305 Use Proxy">Section 5.5.5</a></td> 1465 1541 </tr> 1466 1542 <tr> 1467 1543 <td class="left">307</td> 1468 1544 <td class="left">Temporary Redirect</td> 1469 <td class="left"><a href="#status.307" id="rfc.xref.status.307.1" title="307 Temporary Redirect">Section 4.5.7</a></td>1545 <td class="left"><a href="#status.307" id="rfc.xref.status.307.1" title="307 Temporary Redirect">Section 5.5.7</a></td> 1470 1546 </tr> 1471 1547 <tr> 1472 1548 <td class="left">400</td> 1473 1549 <td class="left">Bad Request</td> 1474 <td class="left"><a href="#status.400" id="rfc.xref.status.400.1" title="400 Bad Request">Section 4.6.1</a></td>1550 <td class="left"><a href="#status.400" id="rfc.xref.status.400.1" title="400 Bad Request">Section 5.6.1</a></td> 1475 1551 </tr> 1476 1552 <tr> … … 1482 1558 <td class="left">402</td> 1483 1559 <td class="left">Payment Required</td> 1484 <td class="left"><a href="#status.402" id="rfc.xref.status.402.1" title="402 Payment Required">Section 4.6.2</a></td>1560 <td class="left"><a href="#status.402" id="rfc.xref.status.402.1" title="402 Payment Required">Section 5.6.2</a></td> 1485 1561 </tr> 1486 1562 <tr> 1487 1563 <td class="left">403</td> 1488 1564 <td class="left">Forbidden</td> 1489 <td class="left"><a href="#status.403" id="rfc.xref.status.403.1" title="403 Forbidden">Section 4.6.3</a></td>1565 <td class="left"><a href="#status.403" id="rfc.xref.status.403.1" title="403 Forbidden">Section 5.6.3</a></td> 1490 1566 </tr> 1491 1567 <tr> 1492 1568 <td class="left">404</td> 1493 1569 <td class="left">Not Found</td> 1494 <td class="left"><a href="#status.404" id="rfc.xref.status.404.1" title="404 Not Found">Section 4.6.4</a></td>1570 <td class="left"><a href="#status.404" id="rfc.xref.status.404.1" title="404 Not Found">Section 5.6.4</a></td> 1495 1571 </tr> 1496 1572 <tr> 1497 1573 <td class="left">405</td> 1498 1574 <td class="left">Method Not Allowed</td> 1499 <td class="left"><a href="#status.405" id="rfc.xref.status.405.1" title="405 Method Not Allowed">Section 4.6.5</a></td>1575 <td class="left"><a href="#status.405" id="rfc.xref.status.405.1" title="405 Method Not Allowed">Section 5.6.5</a></td> 1500 1576 </tr> 1501 1577 <tr> 1502 1578 <td class="left">406</td> 1503 1579 <td class="left">Not Acceptable</td> 1504 <td class="left"><a href="#status.406" id="rfc.xref.status.406.1" title="406 Not Acceptable">Section 4.6.6</a></td>1580 <td class="left"><a href="#status.406" id="rfc.xref.status.406.1" title="406 Not Acceptable">Section 5.6.6</a></td> 1505 1581 </tr> 1506 1582 <tr> … … 1512 1588 <td class="left">408</td> 1513 1589 <td class="left">Request Time-out</td> 1514 <td class="left"><a href="#status.408" id="rfc.xref.status.408.1" title="408 Request Timeout">Section 4.6.7</a></td>1590 <td class="left"><a href="#status.408" id="rfc.xref.status.408.1" title="408 Request Timeout">Section 5.6.7</a></td> 1515 1591 </tr> 1516 1592 <tr> 1517 1593 <td class="left">409</td> 1518 1594 <td class="left">Conflict</td> 1519 <td class="left"><a href="#status.409" id="rfc.xref.status.409.1" title="409 Conflict">Section 4.6.8</a></td>1595 <td class="left"><a href="#status.409" id="rfc.xref.status.409.1" title="409 Conflict">Section 5.6.8</a></td> 1520 1596 </tr> 1521 1597 <tr> 1522 1598 <td class="left">410</td> 1523 1599 <td class="left">Gone</td> 1524 <td class="left"><a href="#status.410" id="rfc.xref.status.410.1" title="410 Gone">Section 4.6.9</a></td>1600 <td class="left"><a href="#status.410" id="rfc.xref.status.410.1" title="410 Gone">Section 5.6.9</a></td> 1525 1601 </tr> 1526 1602 <tr> 1527 1603 <td class="left">411</td> 1528 1604 <td class="left">Length Required</td> 1529 <td class="left"><a href="#status.411" id="rfc.xref.status.411.1" title="411 Length Required">Section 4.6.10</a></td>1605 <td class="left"><a href="#status.411" id="rfc.xref.status.411.1" title="411 Length Required">Section 5.6.10</a></td> 1530 1606 </tr> 1531 1607 <tr> … … 1537 1613 <td class="left">413</td> 1538 1614 <td class="left">Request Representation Too Large</td> 1539 <td class="left"><a href="#status.413" id="rfc.xref.status.413.1" title="413 Request Representation Too Large">Section 4.6.11</a></td>1615 <td class="left"><a href="#status.413" id="rfc.xref.status.413.1" title="413 Request Representation Too Large">Section 5.6.11</a></td> 1540 1616 </tr> 1541 1617 <tr> 1542 1618 <td class="left">414</td> 1543 1619 <td class="left">URI Too Long</td> 1544 <td class="left"><a href="#status.414" id="rfc.xref.status.414.1" title="414 URI Too Long">Section 4.6.12</a></td>1620 <td class="left"><a href="#status.414" id="rfc.xref.status.414.1" title="414 URI Too Long">Section 5.6.12</a></td> 1545 1621 </tr> 1546 1622 <tr> 1547 1623 <td class="left">415</td> 1548 1624 <td class="left">Unsupported Media Type</td> 1549 <td class="left"><a href="#status.415" id="rfc.xref.status.415.1" title="415 Unsupported Media Type">Section 4.6.13</a></td>1625 <td class="left"><a href="#status.415" id="rfc.xref.status.415.1" title="415 Unsupported Media Type">Section 5.6.13</a></td> 1550 1626 </tr> 1551 1627 <tr> … … 1557 1633 <td class="left">417</td> 1558 1634 <td class="left">Expectation Failed</td> 1559 <td class="left"><a href="#status.417" id="rfc.xref.status.417.1" title="417 Expectation Failed">Section 4.6.14</a></td>1635 <td class="left"><a href="#status.417" id="rfc.xref.status.417.1" title="417 Expectation Failed">Section 5.6.14</a></td> 1560 1636 </tr> 1561 1637 <tr> 1562 1638 <td class="left">426</td> 1563 1639 <td class="left">Upgrade Required</td> 1564 <td class="left"><a href="#status.426" id="rfc.xref.status.426.1" title="426 Upgrade Required">Section 4.6.15</a></td>1640 <td class="left"><a href="#status.426" id="rfc.xref.status.426.1" title="426 Upgrade Required">Section 5.6.15</a></td> 1565 1641 </tr> 1566 1642 <tr> 1567 1643 <td class="left">500</td> 1568 1644 <td class="left">Internal Server Error</td> 1569 <td class="left"><a href="#status.500" id="rfc.xref.status.500.1" title="500 Internal Server Error">Section 4.7.1</a></td>1645 <td class="left"><a href="#status.500" id="rfc.xref.status.500.1" title="500 Internal Server Error">Section 5.7.1</a></td> 1570 1646 </tr> 1571 1647 <tr> 1572 1648 <td class="left">501</td> 1573 1649 <td class="left">Not Implemented</td> 1574 <td class="left"><a href="#status.501" id="rfc.xref.status.501.1" title="501 Not Implemented">Section 4.7.2</a></td>1650 <td class="left"><a href="#status.501" id="rfc.xref.status.501.1" title="501 Not Implemented">Section 5.7.2</a></td> 1575 1651 </tr> 1576 1652 <tr> 1577 1653 <td class="left">502</td> 1578 1654 <td class="left">Bad Gateway</td> 1579 <td class="left"><a href="#status.502" id="rfc.xref.status.502.1" title="502 Bad Gateway">Section 4.7.3</a></td>1655 <td class="left"><a href="#status.502" id="rfc.xref.status.502.1" title="502 Bad Gateway">Section 5.7.3</a></td> 1580 1656 </tr> 1581 1657 <tr> 1582 1658 <td class="left">503</td> 1583 1659 <td class="left">Service Unavailable</td> 1584 <td class="left"><a href="#status.503" id="rfc.xref.status.503.1" title="503 Service Unavailable">Section 4.7.4</a></td>1660 <td class="left"><a href="#status.503" id="rfc.xref.status.503.1" title="503 Service Unavailable">Section 5.7.4</a></td> 1585 1661 </tr> 1586 1662 <tr> 1587 1663 <td class="left">504</td> 1588 1664 <td class="left">Gateway Time-out</td> 1589 <td class="left"><a href="#status.504" id="rfc.xref.status.504.1" title="504 Gateway Timeout">Section 4.7.5</a></td>1665 <td class="left"><a href="#status.504" id="rfc.xref.status.504.1" title="504 Gateway Timeout">Section 5.7.5</a></td> 1590 1666 </tr> 1591 1667 <tr> 1592 1668 <td class="left">505</td> 1593 1669 <td class="left">HTTP Version not supported</td> 1594 <td class="left"><a href="#status.505" id="rfc.xref.status.505.1" title="505 HTTP Version Not Supported">Section 4.7.6</a></td>1670 <td class="left"><a href="#status.505" id="rfc.xref.status.505.1" title="505 HTTP Version Not Supported">Section 5.7.6</a></td> 1595 1671 </tr> 1596 1672 </tbody> 1597 1673 </table> 1598 1674 </div> 1599 <p id="rfc.section. 4.1.p.2">Note that this list is not exhaustive — it does not include extension status codes defined in other specifications.</p>1600 <h2 id="rfc.section. 4.2"><a href="#rfc.section.4.2">4.2</a> <a id="status.code.registry" href="#status.code.registry">Status Code Registry</a></h2>1601 <p id="rfc.section. 4.2.p.1">The HTTP Status Code Registry defines the name space for the status-code token in the status-line of an HTTP response.</p>1602 <p id="rfc.section. 4.2.p.2">Values to be added to this name space require IETF Review (see <a href="#RFC5226" id="rfc.xref.RFC5226.2"><cite title="Guidelines for Writing an IANA Considerations Section in RFCs">[RFC5226]</cite></a>, <a href="http://tools.ietf.org/html/rfc5226#section-4.1">Section 4.1</a>).1603 </p> 1604 <p id="rfc.section. 4.2.p.3">The registry itself is maintained at <<a href="http://www.iana.org/assignments/http-status-codes">http://www.iana.org/assignments/http-status-codes</a>>.1605 </p> 1606 <h3 id="rfc.section. 4.2.1"><a href="#rfc.section.4.2.1">4.2.1</a> <a id="considerations.for.new.status.codes" href="#considerations.for.new.status.codes">Considerations for New Status Codes</a></h3>1607 <p id="rfc.section. 4.2.1.p.1">When it is necessary to express new semantics for a HTTP response that aren't specific to a single application or media type,1675 <p id="rfc.section.5.1.p.2">Note that this list is not exhaustive — it does not include extension status codes defined in other specifications.</p> 1676 <h2 id="rfc.section.5.2"><a href="#rfc.section.5.2">5.2</a> <a id="status.code.registry" href="#status.code.registry">Status Code Registry</a></h2> 1677 <p id="rfc.section.5.2.p.1">The HTTP Status Code Registry defines the name space for the status-code token in the status-line of an HTTP response.</p> 1678 <p id="rfc.section.5.2.p.2">Values to be added to this name space require IETF Review (see <a href="#RFC5226" id="rfc.xref.RFC5226.2"><cite title="Guidelines for Writing an IANA Considerations Section in RFCs">[RFC5226]</cite></a>, <a href="http://tools.ietf.org/html/rfc5226#section-4.1">Section 4.1</a>). 1679 </p> 1680 <p id="rfc.section.5.2.p.3">The registry itself is maintained at <<a href="http://www.iana.org/assignments/http-status-codes">http://www.iana.org/assignments/http-status-codes</a>>. 1681 </p> 1682 <h3 id="rfc.section.5.2.1"><a href="#rfc.section.5.2.1">5.2.1</a> <a id="considerations.for.new.status.codes" href="#considerations.for.new.status.codes">Considerations for New Status Codes</a></h3> 1683 <p id="rfc.section.5.2.1.p.1">When it is necessary to express new semantics for a HTTP response that aren't specific to a single application or media type, 1608 1684 and currently defined status codes are inadequate, a new status code can be registered. 1609 1685 </p> 1610 <p id="rfc.section. 4.2.1.p.2">HTTP status codes are generic; that is, they are potentially applicable to any resource, not just one particular media type,1686 <p id="rfc.section.5.2.1.p.2">HTTP status codes are generic; that is, they are potentially applicable to any resource, not just one particular media type, 1611 1687 "type" of resource, or application. As such, it is preferred that new HTTP status codes be registered in a document that isn't 1612 1688 specific to a single application, so that this is clear. 1613 1689 </p> 1614 <p id="rfc.section. 4.2.1.p.3">Definitions of new HTTP status codes typically explain the request conditions that produce a response containing the status1690 <p id="rfc.section.5.2.1.p.3">Definitions of new HTTP status codes typically explain the request conditions that produce a response containing the status 1615 1691 code (e.g., combinations of request header fields and/or method(s)), along with any interactions with response header fields 1616 1692 (e.g., those that are required, those that modify the semantics of the response). 1617 1693 </p> 1618 <p id="rfc.section. 4.2.1.p.4">New HTTP status codes are required to fall under one of the categories defined in <a href="#status.codes" title="Status Codes">Section 4</a>. To allow existing parsers to properly handle them, new status codes cannot disallow a response body, although they can mandate1694 <p id="rfc.section.5.2.1.p.4">New HTTP status codes are required to fall under one of the categories defined in <a href="#status.codes" title="Response Status Codes">Section 5</a>. To allow existing parsers to properly handle them, new status codes cannot disallow a response body, although they can mandate 1619 1695 a zero-length response body. They can require the presence of one or more particular HTTP response header field(s). 1620 1696 </p> 1621 <p id="rfc.section. 4.2.1.p.5">Likewise, their definitions can specify that caches are allowed to use heuristics to determine their freshness (see <a href="#Part6" id="rfc.xref.Part6.10"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>; by default, it is not allowed), and can define how to determine the resource which they carry a representation for (see <a href="#identifying.response.associated.with.representation" title="Identifying the Resource Associated with a Representation">Section 7.1</a>; by default, it is anonymous).1622 </p> 1623 <h2 id="rfc.section. 4.3"><a href="#rfc.section.4.3">4.3</a> <a id="status.1xx" href="#status.1xx">Informational 1xx</a></h2>1697 <p id="rfc.section.5.2.1.p.5">Likewise, their definitions can specify that caches are allowed to use heuristics to determine their freshness (see <a href="#Part6" id="rfc.xref.Part6.10"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>; by default, it is not allowed), and can define how to determine the resource which they carry a representation for (see <a href="#identifying.response.associated.with.representation" title="Identifying the Resource Associated with a Representation">Section 8.1</a>; by default, it is anonymous). 1698 </p> 1699 <h2 id="rfc.section.5.3"><a href="#rfc.section.5.3">5.3</a> <a id="status.1xx" href="#status.1xx">Informational 1xx</a></h2> 1624 1700 <div id="rfc.iref.20"></div> 1625 1701 <div id="rfc.iref.s.2"></div> 1626 <p id="rfc.section. 4.3.p.1">This class of status code indicates a provisional response, consisting only of the status-line and optional header fields,1702 <p id="rfc.section.5.3.p.1">This class of status code indicates a provisional response, consisting only of the status-line and optional header fields, 1627 1703 and is terminated by an empty line. There are no required header fields for this class of status code. Since HTTP/1.0 did 1628 1704 not define any 1xx status codes, servers <em class="bcp14">MUST NOT</em> send a 1xx response to an HTTP/1.0 client except under experimental conditions. 1629 1705 </p> 1630 <p id="rfc.section. 4.3.p.2">A client <em class="bcp14">MUST</em> be prepared to accept one or more 1xx status responses prior to a regular response, even if the client does not expect a <a href="#status.100" class="smpl">1001706 <p id="rfc.section.5.3.p.2">A client <em class="bcp14">MUST</em> be prepared to accept one or more 1xx status responses prior to a regular response, even if the client does not expect a <a href="#status.100" class="smpl">100 1631 1707 (Continue)</a> status message. Unexpected 1xx status responses <em class="bcp14">MAY</em> be ignored by a user agent. 1632 1708 </p> 1633 <p id="rfc.section. 4.3.p.3">Proxies <em class="bcp14">MUST</em> forward 1xx responses, unless the connection between the proxy and its client has been closed, or unless the proxy itself1709 <p id="rfc.section.5.3.p.3">Proxies <em class="bcp14">MUST</em> forward 1xx responses, unless the connection between the proxy and its client has been closed, or unless the proxy itself 1634 1710 requested the generation of the 1xx response. (For example, if a proxy adds an "Expect: 100-continue" field when it forwards 1635 1711 a request, then it need not forward the corresponding <a href="#status.100" class="smpl">100 (Continue)</a> response(s).) … … 1637 1713 <div id="rfc.iref.21"></div> 1638 1714 <div id="rfc.iref.s.3"></div> 1639 <h3 id="rfc.section. 4.3.1"><a href="#rfc.section.4.3.1">4.3.1</a> <a id="status.100" href="#status.100">100 Continue</a></h3>1640 <p id="rfc.section. 4.3.1.p.1">The client <em class="bcp14">SHOULD</em> continue with its request. This interim response is used to inform the client that the initial part of the request has been1715 <h3 id="rfc.section.5.3.1"><a href="#rfc.section.5.3.1">5.3.1</a> <a id="status.100" href="#status.100">100 Continue</a></h3> 1716 <p id="rfc.section.5.3.1.p.1">The client <em class="bcp14">SHOULD</em> continue with its request. This interim response is used to inform the client that the initial part of the request has been 1641 1717 received and has not yet been rejected by the server. The client <em class="bcp14">SHOULD</em> continue by sending the remainder of the request or, if the request has already been completed, ignore this response. The 1642 server <em class="bcp14">MUST</em> send a final response after the request has been completed. See <a href="p1-messaging.html#use.of.the.100.status" title="Use of the 100 (Continue) Status">Section 6. 4.3</a> of <a href="#Part1" id="rfc.xref.Part1.19"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a> for detailed discussion of the use and handling of this status code.1718 server <em class="bcp14">MUST</em> send a final response after the request has been completed. See <a href="p1-messaging.html#use.of.the.100.status" title="Use of the 100 (Continue) Status">Section 6.3</a> of <a href="#Part1" id="rfc.xref.Part1.21"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a> for detailed discussion of the use and handling of this status code. 1643 1719 </p> 1644 1720 <div id="rfc.iref.22"></div> 1645 1721 <div id="rfc.iref.s.4"></div> 1646 <h3 id="rfc.section. 4.3.2"><a href="#rfc.section.4.3.2">4.3.2</a> <a id="status.101" href="#status.101">101 Switching Protocols</a></h3>1647 <p id="rfc.section. 4.3.2.p.1">The server understands and is willing to comply with the client's request, via the <a href="p1-messaging.html#header.upgrade" class="smpl">Upgrade</a> message header field (<a href="p1-messaging.html#header.upgrade" title="Upgrade">Section 6.5</a> of <a href="#Part1" id="rfc.xref.Part1.20"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>), for a change in the application protocol being used on this connection. The server will switch protocols to those defined1722 <h3 id="rfc.section.5.3.2"><a href="#rfc.section.5.3.2">5.3.2</a> <a id="status.101" href="#status.101">101 Switching Protocols</a></h3> 1723 <p id="rfc.section.5.3.2.p.1">The server understands and is willing to comply with the client's request, via the <a href="p1-messaging.html#header.upgrade" class="smpl">Upgrade</a> message header field (<a href="p1-messaging.html#header.upgrade" title="Upgrade">Section 6.4</a> of <a href="#Part1" id="rfc.xref.Part1.22"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>), for a change in the application protocol being used on this connection. The server will switch protocols to those defined 1648 1724 by the response's Upgrade header field immediately after the empty line which terminates the 101 response. 1649 1725 </p> 1650 <p id="rfc.section. 4.3.2.p.2">The protocol <em class="bcp14">SHOULD</em> be switched only when it is advantageous to do so. For example, switching to a newer version of HTTP is advantageous over1726 <p id="rfc.section.5.3.2.p.2">The protocol <em class="bcp14">SHOULD</em> be switched only when it is advantageous to do so. For example, switching to a newer version of HTTP is advantageous over 1651 1727 older versions, and switching to a real-time, synchronous protocol might be advantageous when delivering resources that use 1652 1728 such features. 1653 1729 </p> 1654 <h2 id="rfc.section. 4.4"><a href="#rfc.section.4.4">4.4</a> <a id="status.2xx" href="#status.2xx">Successful 2xx</a></h2>1730 <h2 id="rfc.section.5.4"><a href="#rfc.section.5.4">5.4</a> <a id="status.2xx" href="#status.2xx">Successful 2xx</a></h2> 1655 1731 <div id="rfc.iref.23"></div> 1656 1732 <div id="rfc.iref.s.5"></div> 1657 <p id="rfc.section. 4.4.p.1">This class of status code indicates that the client's request was successfully received, understood, and accepted.</p>1733 <p id="rfc.section.5.4.p.1">This class of status code indicates that the client's request was successfully received, understood, and accepted.</p> 1658 1734 <div id="rfc.iref.24"></div> 1659 1735 <div id="rfc.iref.s.6"></div> 1660 <h3 id="rfc.section. 4.4.1"><a href="#rfc.section.4.4.1">4.4.1</a> <a id="status.200" href="#status.200">200 OK</a></h3>1661 <p id="rfc.section. 4.4.1.p.1">The request has succeeded. The payload returned with the response is dependent on the method used in the request, for example: </p>1736 <h3 id="rfc.section.5.4.1"><a href="#rfc.section.5.4.1">5.4.1</a> <a id="status.200" href="#status.200">200 OK</a></h3> 1737 <p id="rfc.section.5.4.1.p.1">The request has succeeded. The payload returned with the response is dependent on the method used in the request, for example: </p> 1662 1738 <dl> 1663 1739 <dt>GET</dt> … … 1670 1746 <dd>a representation containing the request message as received by the end server.</dd> 1671 1747 </dl> 1672 <p id="rfc.section. 4.4.1.p.2">Caches <em class="bcp14">MAY</em> use a heuristic (see <a href="p6-cache.html#heuristic.freshness" title="Calculating Heuristic Freshness">Section 4.1.2</a> of <a href="#Part6" id="rfc.xref.Part6.11"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>) to determine freshness for 200 responses.1748 <p id="rfc.section.5.4.1.p.2">Caches <em class="bcp14">MAY</em> use a heuristic (see <a href="p6-cache.html#heuristic.freshness" title="Calculating Heuristic Freshness">Section 4.1.2</a> of <a href="#Part6" id="rfc.xref.Part6.11"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>) to determine freshness for 200 responses. 1673 1749 </p> 1674 1750 <div id="rfc.iref.25"></div> 1675 1751 <div id="rfc.iref.s.7"></div> 1676 <h3 id="rfc.section. 4.4.2"><a href="#rfc.section.4.4.2">4.4.2</a> <a id="status.201" href="#status.201">201 Created</a></h3>1677 <p id="rfc.section. 4.4.2.p.1">The request has been fulfilled and has resulted in one or more new resources being created.</p>1678 <p id="rfc.section. 4.4.2.p.2">Newly created resources are typically linked to from the response payload, with the most relevant URI also being carried in1752 <h3 id="rfc.section.5.4.2"><a href="#rfc.section.5.4.2">5.4.2</a> <a id="status.201" href="#status.201">201 Created</a></h3> 1753 <p id="rfc.section.5.4.2.p.1">The request has been fulfilled and has resulted in one or more new resources being created.</p> 1754 <p id="rfc.section.5.4.2.p.2">Newly created resources are typically linked to from the response payload, with the most relevant URI also being carried in 1679 1755 the <a href="#header.location" class="smpl">Location</a> header field. If the newly created resource's URI is the same as the Effective Request URI, this information can be omitted 1680 1756 (e.g., in the case of a response to a PUT request). 1681 1757 </p> 1682 <p id="rfc.section. 4.4.2.p.3">The origin server <em class="bcp14">MUST</em> create the resource(s) before returning the 201 status code. If the action cannot be carried out immediately, the server <em class="bcp14">SHOULD</em> respond with <a href="#status.202" class="smpl">202 (Accepted)</a> response instead.1683 </p> 1684 <p id="rfc.section. 4.4.2.p.4">A 201 response <em class="bcp14">MAY</em> contain an <a href="p4-conditional.html#header.etag" class="smpl">ETag</a> response header field indicating the current value of the entity-tag for the representation of the resource identified by1758 <p id="rfc.section.5.4.2.p.3">The origin server <em class="bcp14">MUST</em> create the resource(s) before returning the 201 status code. If the action cannot be carried out immediately, the server <em class="bcp14">SHOULD</em> respond with <a href="#status.202" class="smpl">202 (Accepted)</a> response instead. 1759 </p> 1760 <p id="rfc.section.5.4.2.p.4">A 201 response <em class="bcp14">MAY</em> contain an <a href="p4-conditional.html#header.etag" class="smpl">ETag</a> response header field indicating the current value of the entity-tag for the representation of the resource identified by 1685 1761 the <a href="#header.location" class="smpl">Location</a> header field or, in case the Location header field was omitted, by the Effective Request URI (see <a href="p4-conditional.html#header.etag" title="ETag">Section 2.3</a> of <a href="#Part4" id="rfc.xref.Part4.10"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a>). 1686 1762 </p> 1687 1763 <div id="rfc.iref.26"></div> 1688 1764 <div id="rfc.iref.s.8"></div> 1689 <h3 id="rfc.section. 4.4.3"><a href="#rfc.section.4.4.3">4.4.3</a> <a id="status.202" href="#status.202">202 Accepted</a></h3>1690 <p id="rfc.section. 4.4.3.p.1">The request has been accepted for processing, but the processing has not been completed. The request might or might not eventually1765 <h3 id="rfc.section.5.4.3"><a href="#rfc.section.5.4.3">5.4.3</a> <a id="status.202" href="#status.202">202 Accepted</a></h3> 1766 <p id="rfc.section.5.4.3.p.1">The request has been accepted for processing, but the processing has not been completed. The request might or might not eventually 1691 1767 be acted upon, as it might be disallowed when processing actually takes place. There is no facility for re-sending a status 1692 1768 code from an asynchronous operation such as this. 1693 1769 </p> 1694 <p id="rfc.section. 4.4.3.p.2">The 202 response is intentionally non-committal. Its purpose is to allow a server to accept a request for some other process1770 <p id="rfc.section.5.4.3.p.2">The 202 response is intentionally non-committal. Its purpose is to allow a server to accept a request for some other process 1695 1771 (perhaps a batch-oriented process that is only run once per day) without requiring that the user agent's connection to the 1696 1772 server persist until the process is completed. The representation returned with this response <em class="bcp14">SHOULD</em> include an indication of the request's current status and either a pointer to a status monitor or some estimate of when the … … 1699 1775 <div id="rfc.iref.27"></div> 1700 1776 <div id="rfc.iref.s.9"></div> 1701 <h3 id="rfc.section. 4.4.4"><a href="#rfc.section.4.4.4">4.4.4</a> <a id="status.203" href="#status.203">203 Non-Authoritative Information</a></h3>1702 <p id="rfc.section. 4.4.4.p.1">The representation in the response has been transformed or otherwise modified by a transforming proxy (<a href="p1-messaging.html#intermediaries" title="Intermediaries">Section 2.4</a> of <a href="#Part1" id="rfc.xref.Part1.21"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>). Note that the behavior of transforming intermediaries is controlled by the no-transform Cache-Control directive (<a href="p6-cache.html#header.cache-control" title="Cache-Control">Section 7.2</a> of <a href="#Part6" id="rfc.xref.Part6.12"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>).1703 </p> 1704 <p id="rfc.section. 4.4.4.p.2">This status code is only appropriate when the response status code would have been <a href="#status.200" class="smpl">200 (OK)</a> otherwise. When the status code before transformation would have been different, the 214 Transformation Applied warn-code1777 <h3 id="rfc.section.5.4.4"><a href="#rfc.section.5.4.4">5.4.4</a> <a id="status.203" href="#status.203">203 Non-Authoritative Information</a></h3> 1778 <p id="rfc.section.5.4.4.p.1">The representation in the response has been transformed or otherwise modified by a transforming proxy (<a href="p1-messaging.html#intermediaries" title="Intermediaries">Section 2.3</a> of <a href="#Part1" id="rfc.xref.Part1.23"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>). Note that the behavior of transforming intermediaries is controlled by the no-transform Cache-Control directive (<a href="p6-cache.html#header.cache-control" title="Cache-Control">Section 7.2</a> of <a href="#Part6" id="rfc.xref.Part6.12"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>). 1779 </p> 1780 <p id="rfc.section.5.4.4.p.2">This status code is only appropriate when the response status code would have been <a href="#status.200" class="smpl">200 (OK)</a> otherwise. When the status code before transformation would have been different, the 214 Transformation Applied warn-code 1705 1781 (<a href="p6-cache.html#header.warning" title="Warning">Section 7.6</a> of <a href="#Part6" id="rfc.xref.Part6.13"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>) is appropriate. 1706 1782 </p> 1707 <p id="rfc.section. 4.4.4.p.3">Caches <em class="bcp14">MAY</em> use a heuristic (see <a href="p6-cache.html#heuristic.freshness" title="Calculating Heuristic Freshness">Section 4.1.2</a> of <a href="#Part6" id="rfc.xref.Part6.14"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>) to determine freshness for 203 responses.1783 <p id="rfc.section.5.4.4.p.3">Caches <em class="bcp14">MAY</em> use a heuristic (see <a href="p6-cache.html#heuristic.freshness" title="Calculating Heuristic Freshness">Section 4.1.2</a> of <a href="#Part6" id="rfc.xref.Part6.14"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>) to determine freshness for 203 responses. 1708 1784 </p> 1709 1785 <div id="rfc.iref.28"></div> 1710 1786 <div id="rfc.iref.s.10"></div> 1711 <h3 id="rfc.section. 4.4.5"><a href="#rfc.section.4.4.5">4.4.5</a> <a id="status.204" href="#status.204">204 No Content</a></h3>1712 <p id="rfc.section. 4.4.5.p.1">The 204 (No Content) status code indicates that the server has successfully fulfilled the request and that there is no additional1787 <h3 id="rfc.section.5.4.5"><a href="#rfc.section.5.4.5">5.4.5</a> <a id="status.204" href="#status.204">204 No Content</a></h3> 1788 <p id="rfc.section.5.4.5.p.1">The 204 (No Content) status code indicates that the server has successfully fulfilled the request and that there is no additional 1713 1789 content to return in the response payload body. Metadata in the response header fields refer to the target resource and its 1714 1790 current representation after the requested action. 1715 1791 </p> 1716 <p id="rfc.section. 4.4.5.p.2">For example, if a 204 status code is received in response to a PUT request and the response contains an <a href="p4-conditional.html#header.etag" class="smpl">ETag</a> header field, then the PUT was successful and the ETag field-value contains the entity-tag for the new representation of that1792 <p id="rfc.section.5.4.5.p.2">For example, if a 204 status code is received in response to a PUT request and the response contains an <a href="p4-conditional.html#header.etag" class="smpl">ETag</a> header field, then the PUT was successful and the ETag field-value contains the entity-tag for the new representation of that 1717 1793 target resource. 1718 1794 </p> 1719 <p id="rfc.section. 4.4.5.p.3">The 204 response allows a server to indicate that the action has been successfully applied to the target resource while implying1795 <p id="rfc.section.5.4.5.p.3">The 204 response allows a server to indicate that the action has been successfully applied to the target resource while implying 1720 1796 that the user agent <em class="bcp14">SHOULD NOT</em> traverse away from its current "document view" (if any). The server assumes that the user agent will provide some indication 1721 1797 of the success to its user, in accord with its own interface, and apply any new or updated metadata in the response to the 1722 1798 active representation. 1723 1799 </p> 1724 <p id="rfc.section. 4.4.5.p.4">For example, a 204 status code is commonly used with document editing interfaces corresponding to a "save" action, such that1800 <p id="rfc.section.5.4.5.p.4">For example, a 204 status code is commonly used with document editing interfaces corresponding to a "save" action, such that 1725 1801 the document being saved remains available to the user for editing. It is also frequently used with interfaces that expect 1726 1802 automated data transfers to be prevalent, such as within distributed version control systems. 1727 1803 </p> 1728 <p id="rfc.section. 4.4.5.p.5">The 204 response <em class="bcp14">MUST NOT</em> include a message body, and thus is always terminated by the first empty line after the header fields.1804 <p id="rfc.section.5.4.5.p.5">The 204 response <em class="bcp14">MUST NOT</em> include a message body, and thus is always terminated by the first empty line after the header fields. 1729 1805 </p> 1730 1806 <div id="rfc.iref.29"></div> 1731 1807 <div id="rfc.iref.s.11"></div> 1732 <h3 id="rfc.section. 4.4.6"><a href="#rfc.section.4.4.6">4.4.6</a> <a id="status.205" href="#status.205">205 Reset Content</a></h3>1733 <p id="rfc.section. 4.4.6.p.1">The server has fulfilled the request and the user agent <em class="bcp14">SHOULD</em> reset the document view which caused the request to be sent. This response is primarily intended to allow input for actions1808 <h3 id="rfc.section.5.4.6"><a href="#rfc.section.5.4.6">5.4.6</a> <a id="status.205" href="#status.205">205 Reset Content</a></h3> 1809 <p id="rfc.section.5.4.6.p.1">The server has fulfilled the request and the user agent <em class="bcp14">SHOULD</em> reset the document view which caused the request to be sent. This response is primarily intended to allow input for actions 1734 1810 to take place via user input, followed by a clearing of the form in which the input is given so that the user can easily initiate 1735 1811 another input action. 1736 1812 </p> 1737 <p id="rfc.section. 4.4.6.p.2">The message body included with the response <em class="bcp14">MUST</em> be empty. Note that receivers still need to parse the response according to the algorithm defined in <a href="p1-messaging.html#message.body" title="Message Body">Section 3.3</a> of <a href="#Part1" id="rfc.xref.Part1.22"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>.1738 </p> 1739 <h2 id="rfc.section. 4.5"><a href="#rfc.section.4.5">4.5</a> <a id="status.3xx" href="#status.3xx">Redirection 3xx</a></h2>1813 <p id="rfc.section.5.4.6.p.2">The message body included with the response <em class="bcp14">MUST</em> be empty. Note that receivers still need to parse the response according to the algorithm defined in <a href="p1-messaging.html#message.body" title="Message Body">Section 3.3</a> of <a href="#Part1" id="rfc.xref.Part1.24"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>. 1814 </p> 1815 <h2 id="rfc.section.5.5"><a href="#rfc.section.5.5">5.5</a> <a id="status.3xx" href="#status.3xx">Redirection 3xx</a></h2> 1740 1816 <div id="rfc.iref.30"></div> 1741 1817 <div id="rfc.iref.s.12"></div> 1742 <p id="rfc.section. 4.5.p.1">This class of status code indicates that further action needs to be taken by the user agent in order to fulfill the request.1818 <p id="rfc.section.5.5.p.1">This class of status code indicates that further action needs to be taken by the user agent in order to fulfill the request. 1743 1819 If the required action involves a subsequent HTTP request, it <em class="bcp14">MAY</em> be carried out by the user agent without interaction with the user if and only if the method used in the second request is 1744 known to be "safe", as defined in <a href="#safe.methods" title="Safe Methods">Section 2.1.1</a>.1745 </p> 1746 <p id="rfc.section. 4.5.p.2">There are several types of redirects: </p>1820 known to be "safe", as defined in <a href="#safe.methods" title="Safe Methods">Section 3.1.1</a>. 1821 </p> 1822 <p id="rfc.section.5.5.p.2">There are several types of redirects: </p> 1747 1823 <ol> 1748 1824 <li> … … 1758 1834 </li> 1759 1835 <li> 1760 <p>Redirection offering a choice of matching resources for use by agent-driven content negotiation (<a href="#agent-driven.negotiation" title="Agent-driven Negotiation">Section 8.2</a>). This is status code <a href="#status.300" class="smpl">300 (Multiple Choices)</a>.1836 <p>Redirection offering a choice of matching resources for use by agent-driven content negotiation (<a href="#agent-driven.negotiation" title="Agent-driven Negotiation">Section 9.2</a>). This is status code <a href="#status.300" class="smpl">300 (Multiple Choices)</a>. 1761 1837 </p> 1762 1838 </li> … … 1767 1843 </li> 1768 1844 </ol> 1769 <div class="note" id="rfc.section. 4.5.p.3">1845 <div class="note" id="rfc.section.5.5.p.3"> 1770 1846 <p> <b>Note:</b> In HTTP/1.0, only the status codes <a href="#status.301" class="smpl">301 (Moved Permanently)</a> and <a href="#status.302" class="smpl">302 (Found)</a> were defined for the first type of redirect, and the second type did not exist at all (<a href="#RFC1945" id="rfc.xref.RFC1945.1"><cite title="Hypertext Transfer Protocol -- HTTP/1.0">[RFC1945]</cite></a>, <a href="http://tools.ietf.org/html/rfc1945#section-9.3">Section 9.3</a>). However it turned out that web forms using POST expected redirects to change the operation for the subsequent request to 1771 1847 retrieval (GET). To address this use case, HTTP/1.1 introduced the second type of redirect with the status code <a href="#status.303" class="smpl">303 (See Other)</a> (<a href="#RFC2068" id="rfc.xref.RFC2068.1"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2068]</cite></a>, <a href="http://tools.ietf.org/html/rfc2068#section-10.3.4">Section 10.3.4</a>). As user agents did not change their behavior to maintain backwards compatibility, the first revision of HTTP/1.1 added 1772 yet another status code, <a href="#status.307" class="smpl">307 (Temporary Redirect)</a>, for which the backwards compatibility problems did not apply (<a href="#RFC2616" id="rfc.xref.RFC2616. 2"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a>, <a href="http://tools.ietf.org/html/rfc2616#section-10.3.8">Section 10.3.8</a>). Over 10 years later, most user agents still do method rewriting for status codes <a href="#status.301" class="smpl">301</a> and <a href="#status.302" class="smpl">302</a>, therefore this specification makes that behavior conformant in case the original request was POST.1848 yet another status code, <a href="#status.307" class="smpl">307 (Temporary Redirect)</a>, for which the backwards compatibility problems did not apply (<a href="#RFC2616" id="rfc.xref.RFC2616.1"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a>, <a href="http://tools.ietf.org/html/rfc2616#section-10.3.8">Section 10.3.8</a>). Over 10 years later, most user agents still do method rewriting for status codes <a href="#status.301" class="smpl">301</a> and <a href="#status.302" class="smpl">302</a>, therefore this specification makes that behavior conformant in case the original request was POST. 1773 1849 </p> 1774 1850 </div> 1775 <p id="rfc.section. 4.5.p.4">A <a href="#header.location" class="smpl">Location</a> header field on a 3xx response indicates that a client <em class="bcp14">MAY</em> automatically redirect to the URI provided; see <a href="#header.location" id="rfc.xref.header.location.3" title="Location">Section 9.13</a>.1776 </p> 1777 <p id="rfc.section. 4.5.p.5">Note that for methods not known to be "safe", as defined in <a href="#safe.methods" title="Safe Methods">Section 2.1.1</a>, automatic redirection needs to done with care, since the redirect might change the conditions under which the request was1851 <p id="rfc.section.5.5.p.4">A <a href="#header.location" class="smpl">Location</a> header field on a 3xx response indicates that a client <em class="bcp14">MAY</em> automatically redirect to the URI provided; see <a href="#header.location" id="rfc.xref.header.location.3" title="Location">Section 10.13</a>. 1852 </p> 1853 <p id="rfc.section.5.5.p.5">Note that for methods not known to be "safe", as defined in <a href="#safe.methods" title="Safe Methods">Section 3.1.1</a>, automatic redirection needs to done with care, since the redirect might change the conditions under which the request was 1778 1854 issued. 1779 1855 </p> 1780 <p id="rfc.section. 4.5.p.6">Clients <em class="bcp14">SHOULD</em> detect and intervene in cyclical redirections (i.e., "infinite" redirection loops).1781 </p> 1782 <div class="note" id="rfc.section. 4.5.p.7">1856 <p id="rfc.section.5.5.p.6">Clients <em class="bcp14">SHOULD</em> detect and intervene in cyclical redirections (i.e., "infinite" redirection loops). 1857 </p> 1858 <div class="note" id="rfc.section.5.5.p.7"> 1783 1859 <p> <b>Note:</b> An earlier version of this specification recommended a maximum of five redirections (<a href="#RFC2068" id="rfc.xref.RFC2068.2"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2068]</cite></a>, <a href="http://tools.ietf.org/html/rfc2068#section-10.3">Section 10.3</a>). Content developers need to be aware that some clients might implement such a fixed limitation. 1784 1860 </p> … … 1786 1862 <div id="rfc.iref.31"></div> 1787 1863 <div id="rfc.iref.s.13"></div> 1788 <h3 id="rfc.section. 4.5.1"><a href="#rfc.section.4.5.1">4.5.1</a> <a id="status.300" href="#status.300">300 Multiple Choices</a></h3>1789 <p id="rfc.section. 4.5.1.p.1">The target resource has more than one representation, each with its own specific location, and agent-driven negotiation information1790 (<a href="#content.negotiation" title="Content Negotiation">Section 8</a>) is being provided so that the user (or user agent) can select a preferred representation by redirecting its request to that1864 <h3 id="rfc.section.5.5.1"><a href="#rfc.section.5.5.1">5.5.1</a> <a id="status.300" href="#status.300">300 Multiple Choices</a></h3> 1865 <p id="rfc.section.5.5.1.p.1">The target resource has more than one representation, each with its own specific location, and agent-driven negotiation information 1866 (<a href="#content.negotiation" title="Content Negotiation">Section 9</a>) is being provided so that the user (or user agent) can select a preferred representation by redirecting its request to that 1791 1867 location. 1792 1868 </p> 1793 <p id="rfc.section. 4.5.1.p.2">Unless it was a HEAD request, the response <em class="bcp14">SHOULD</em> include a representation containing a list of representation metadata and location(s) from which the user or user agent can1869 <p id="rfc.section.5.5.1.p.2">Unless it was a HEAD request, the response <em class="bcp14">SHOULD</em> include a representation containing a list of representation metadata and location(s) from which the user or user agent can 1794 1870 choose the one most appropriate. Depending upon the format and the capabilities of the user agent, selection of the most appropriate 1795 1871 choice <em class="bcp14">MAY</em> be performed automatically. However, this specification does not define any standard for such automatic selection. 1796 1872 </p> 1797 <p id="rfc.section. 4.5.1.p.3">If the server has a preferred choice of representation, it <em class="bcp14">SHOULD</em> include the specific URI for that representation in the <a href="#header.location" class="smpl">Location</a> field; user agents <em class="bcp14">MAY</em> use the Location field value for automatic redirection.1798 </p> 1799 <p id="rfc.section. 4.5.1.p.4">Caches <em class="bcp14">MAY</em> use a heuristic (see <a href="p6-cache.html#heuristic.freshness" title="Calculating Heuristic Freshness">Section 4.1.2</a> of <a href="#Part6" id="rfc.xref.Part6.15"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>) to determine freshness for 300 responses.1873 <p id="rfc.section.5.5.1.p.3">If the server has a preferred choice of representation, it <em class="bcp14">SHOULD</em> include the specific URI for that representation in the <a href="#header.location" class="smpl">Location</a> field; user agents <em class="bcp14">MAY</em> use the Location field value for automatic redirection. 1874 </p> 1875 <p id="rfc.section.5.5.1.p.4">Caches <em class="bcp14">MAY</em> use a heuristic (see <a href="p6-cache.html#heuristic.freshness" title="Calculating Heuristic Freshness">Section 4.1.2</a> of <a href="#Part6" id="rfc.xref.Part6.15"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>) to determine freshness for 300 responses. 1800 1876 </p> 1801 1877 <div id="rfc.iref.32"></div> 1802 1878 <div id="rfc.iref.s.14"></div> 1803 <h3 id="rfc.section. 4.5.2"><a href="#rfc.section.4.5.2">4.5.2</a> <a id="status.301" href="#status.301">301 Moved Permanently</a></h3>1804 <p id="rfc.section. 4.5.2.p.1">The target resource has been assigned a new permanent URI and any future references to this resource <em class="bcp14">SHOULD</em> use one of the returned URIs. Clients with link editing capabilities ought to automatically re-link references to the effective1879 <h3 id="rfc.section.5.5.2"><a href="#rfc.section.5.5.2">5.5.2</a> <a id="status.301" href="#status.301">301 Moved Permanently</a></h3> 1880 <p id="rfc.section.5.5.2.p.1">The target resource has been assigned a new permanent URI and any future references to this resource <em class="bcp14">SHOULD</em> use one of the returned URIs. Clients with link editing capabilities ought to automatically re-link references to the effective 1805 1881 request URI to one or more of the new references returned by the server, where possible. 1806 1882 </p> 1807 <p id="rfc.section. 4.5.2.p.2">Caches <em class="bcp14">MAY</em> use a heuristic (see <a href="p6-cache.html#heuristic.freshness" title="Calculating Heuristic Freshness">Section 4.1.2</a> of <a href="#Part6" id="rfc.xref.Part6.16"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>) to determine freshness for 301 responses.1808 </p> 1809 <p id="rfc.section. 4.5.2.p.3">The new permanent URI <em class="bcp14">SHOULD</em> be given by the <a href="#header.location" class="smpl">Location</a> field in the response. A response payload can contain a short hypertext note with a hyperlink to the new URI(s).1810 </p> 1811 <div class="note" id="rfc.section. 4.5.2.p.4">1883 <p id="rfc.section.5.5.2.p.2">Caches <em class="bcp14">MAY</em> use a heuristic (see <a href="p6-cache.html#heuristic.freshness" title="Calculating Heuristic Freshness">Section 4.1.2</a> of <a href="#Part6" id="rfc.xref.Part6.16"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>) to determine freshness for 301 responses. 1884 </p> 1885 <p id="rfc.section.5.5.2.p.3">The new permanent URI <em class="bcp14">SHOULD</em> be given by the <a href="#header.location" class="smpl">Location</a> field in the response. A response payload can contain a short hypertext note with a hyperlink to the new URI(s). 1886 </p> 1887 <div class="note" id="rfc.section.5.5.2.p.4"> 1812 1888 <p> <b>Note:</b> For historic reasons, user agents <em class="bcp14">MAY</em> change the request method from POST to GET for the subsequent request. If this behavior is undesired, status code <a href="#status.307" class="smpl">307 (Temporary Redirect)</a> can be used instead. 1813 1889 </p> … … 1815 1891 <div id="rfc.iref.33"></div> 1816 1892 <div id="rfc.iref.s.15"></div> 1817 <h3 id="rfc.section. 4.5.3"><a href="#rfc.section.4.5.3">4.5.3</a> <a id="status.302" href="#status.302">302 Found</a></h3>1818 <p id="rfc.section. 4.5.3.p.1">The target resource resides temporarily under a different URI. Since the redirection might be altered on occasion, the client <em class="bcp14">SHOULD</em> continue to use the effective request URI for future requests.1819 </p> 1820 <p id="rfc.section. 4.5.3.p.2">The temporary URI <em class="bcp14">SHOULD</em> be given by the <a href="#header.location" class="smpl">Location</a> field in the response. A response payload can contain a short hypertext note with a hyperlink to the new URI(s).1821 </p> 1822 <div class="note" id="rfc.section. 4.5.3.p.3">1893 <h3 id="rfc.section.5.5.3"><a href="#rfc.section.5.5.3">5.5.3</a> <a id="status.302" href="#status.302">302 Found</a></h3> 1894 <p id="rfc.section.5.5.3.p.1">The target resource resides temporarily under a different URI. Since the redirection might be altered on occasion, the client <em class="bcp14">SHOULD</em> continue to use the effective request URI for future requests. 1895 </p> 1896 <p id="rfc.section.5.5.3.p.2">The temporary URI <em class="bcp14">SHOULD</em> be given by the <a href="#header.location" class="smpl">Location</a> field in the response. A response payload can contain a short hypertext note with a hyperlink to the new URI(s). 1897 </p> 1898 <div class="note" id="rfc.section.5.5.3.p.3"> 1823 1899 <p> <b>Note:</b> For historic reasons, user agents <em class="bcp14">MAY</em> change the request method from POST to GET for the subsequent request. If this behavior is undesired, status code <a href="#status.307" class="smpl">307 (Temporary Redirect)</a> can be used instead. 1824 1900 </p> … … 1826 1902 <div id="rfc.iref.34"></div> 1827 1903 <div id="rfc.iref.s.16"></div> 1828 <h3 id="rfc.section. 4.5.4"><a href="#rfc.section.4.5.4">4.5.4</a> <a id="status.303" href="#status.303">303 See Other</a></h3>1829 <p id="rfc.section. 4.5.4.p.1">The 303 status code indicates that the server is redirecting the user agent to a different resource, as indicated by a URI1904 <h3 id="rfc.section.5.5.4"><a href="#rfc.section.5.5.4">5.5.4</a> <a id="status.303" href="#status.303">303 See Other</a></h3> 1905 <p id="rfc.section.5.5.4.p.1">The 303 status code indicates that the server is redirecting the user agent to a different resource, as indicated by a URI 1830 1906 in the <a href="#header.location" class="smpl">Location</a> header field, that is intended to provide an indirect response to the original request. In order to satisfy the original request, 1831 1907 a user agent <em class="bcp14">SHOULD</em> perform a retrieval request using the Location URI (a GET or HEAD request if using HTTP), which can itself be redirected further, … … 1833 1909 not considered equivalent to the effective request URI. 1834 1910 </p> 1835 <p id="rfc.section. 4.5.4.p.2">This status code is generally applicable to any HTTP method. It is primarily used to allow the output of a POST action to1911 <p id="rfc.section.5.5.4.p.2">This status code is generally applicable to any HTTP method. It is primarily used to allow the output of a POST action to 1836 1912 redirect the user agent to a selected resource, since doing so provides the information corresponding to the POST response 1837 1913 in a form that can be separately identified, bookmarked, and cached independent of the original request. 1838 1914 </p> 1839 <p id="rfc.section. 4.5.4.p.3">A 303 response to a GET request indicates that the requested resource does not have a representation of its own that can be1915 <p id="rfc.section.5.5.4.p.3">A 303 response to a GET request indicates that the requested resource does not have a representation of its own that can be 1840 1916 transferred by the server over HTTP. The <a href="#header.location" class="smpl">Location</a> URI indicates a resource that is descriptive of the target resource, such that the follow-on representation might be useful 1841 1917 to recipients without implying that it adequately represents the target resource. Note that answers to the questions of what … … 1843 1919 and thus entirely determined by the URI owner(s). 1844 1920 </p> 1845 <p id="rfc.section. 4.5.4.p.4">Except for responses to a HEAD request, the representation of a 303 response <em class="bcp14">SHOULD</em> contain a short hypertext note with a hyperlink to the <a href="#header.location" class="smpl">Location</a> URI.1921 <p id="rfc.section.5.5.4.p.4">Except for responses to a HEAD request, the representation of a 303 response <em class="bcp14">SHOULD</em> contain a short hypertext note with a hyperlink to the <a href="#header.location" class="smpl">Location</a> URI. 1846 1922 </p> 1847 1923 <div id="rfc.iref.35"></div> 1848 1924 <div id="rfc.iref.s.17"></div> 1849 <h3 id="rfc.section. 4.5.5"><a href="#rfc.section.4.5.5">4.5.5</a> <a id="status.305" href="#status.305">305 Use Proxy</a></h3>1850 <p id="rfc.section. 4.5.5.p.1">The 305 status code was defined in a previous version of this specification (see <a href="#changes.from.rfc.2616" title="Changes from RFC 2616">Appendix C</a>), and is now deprecated.1925 <h3 id="rfc.section.5.5.5"><a href="#rfc.section.5.5.5">5.5.5</a> <a id="status.305" href="#status.305">305 Use Proxy</a></h3> 1926 <p id="rfc.section.5.5.5.p.1">The 305 status code was defined in a previous version of this specification (see <a href="#changes.from.rfc.2616" title="Changes from RFC 2616">Appendix C</a>), and is now deprecated. 1851 1927 </p> 1852 1928 <div id="rfc.iref.36"></div> 1853 1929 <div id="rfc.iref.s.18"></div> 1854 <h3 id="rfc.section. 4.5.6"><a href="#rfc.section.4.5.6">4.5.6</a> <a id="status.306" href="#status.306">306 (Unused)</a></h3>1855 <p id="rfc.section. 4.5.6.p.1">The 306 status code was used in a previous version of the specification, is no longer used, and the code is reserved.</p>1930 <h3 id="rfc.section.5.5.6"><a href="#rfc.section.5.5.6">5.5.6</a> <a id="status.306" href="#status.306">306 (Unused)</a></h3> 1931 <p id="rfc.section.5.5.6.p.1">The 306 status code was used in a previous version of the specification, is no longer used, and the code is reserved.</p> 1856 1932 <div id="rfc.iref.37"></div> 1857 1933 <div id="rfc.iref.s.19"></div> 1858 <h3 id="rfc.section. 4.5.7"><a href="#rfc.section.4.5.7">4.5.7</a> <a id="status.307" href="#status.307">307 Temporary Redirect</a></h3>1859 <p id="rfc.section. 4.5.7.p.1">The target resource resides temporarily under a different URI. Since the redirection can change over time, the client <em class="bcp14">SHOULD</em> continue to use the effective request URI for future requests.1860 </p> 1861 <p id="rfc.section. 4.5.7.p.2">The temporary URI <em class="bcp14">SHOULD</em> be given by the <a href="#header.location" class="smpl">Location</a> field in the response. A response payload can contain a short hypertext note with a hyperlink to the new URI(s).1862 </p> 1863 <div class="note" id="rfc.section. 4.5.7.p.3">1934 <h3 id="rfc.section.5.5.7"><a href="#rfc.section.5.5.7">5.5.7</a> <a id="status.307" href="#status.307">307 Temporary Redirect</a></h3> 1935 <p id="rfc.section.5.5.7.p.1">The target resource resides temporarily under a different URI. Since the redirection can change over time, the client <em class="bcp14">SHOULD</em> continue to use the effective request URI for future requests. 1936 </p> 1937 <p id="rfc.section.5.5.7.p.2">The temporary URI <em class="bcp14">SHOULD</em> be given by the <a href="#header.location" class="smpl">Location</a> field in the response. A response payload can contain a short hypertext note with a hyperlink to the new URI(s). 1938 </p> 1939 <div class="note" id="rfc.section.5.5.7.p.3"> 1864 1940 <p> <b>Note:</b> This status code is similar to <a href="#status.302" class="smpl">302 (Found)</a>, except that it does not allow rewriting the request method from POST to GET. This specification defines no equivalent counterpart 1865 1941 for <a href="#status.301" class="smpl">301 (Moved … … 1867 1943 </p> 1868 1944 </div> 1869 <h2 id="rfc.section. 4.6"><a href="#rfc.section.4.6">4.6</a> <a id="status.4xx" href="#status.4xx">Client Error 4xx</a></h2>1945 <h2 id="rfc.section.5.6"><a href="#rfc.section.5.6">5.6</a> <a id="status.4xx" href="#status.4xx">Client Error 4xx</a></h2> 1870 1946 <div id="rfc.iref.38"></div> 1871 1947 <div id="rfc.iref.s.20"></div> 1872 <p id="rfc.section. 4.6.p.1">The 4xx class of status code is intended for cases in which the client seems to have erred. Except when responding to a HEAD1948 <p id="rfc.section.5.6.p.1">The 4xx class of status code is intended for cases in which the client seems to have erred. Except when responding to a HEAD 1873 1949 request, the server <em class="bcp14">SHOULD</em> include a representation containing an explanation of the error situation, and whether it is a temporary or permanent condition. 1874 1950 These status codes are applicable to any request method. User agents <em class="bcp14">SHOULD</em> display any included representation to the user. … … 1876 1952 <div id="rfc.iref.39"></div> 1877 1953 <div id="rfc.iref.s.21"></div> 1878 <h3 id="rfc.section. 4.6.1"><a href="#rfc.section.4.6.1">4.6.1</a> <a id="status.400" href="#status.400">400 Bad Request</a></h3>1879 <p id="rfc.section. 4.6.1.p.1">The server cannot or will not process the request, due to a client error (e.g., malformed syntax).</p>1954 <h3 id="rfc.section.5.6.1"><a href="#rfc.section.5.6.1">5.6.1</a> <a id="status.400" href="#status.400">400 Bad Request</a></h3> 1955 <p id="rfc.section.5.6.1.p.1">The server cannot or will not process the request, due to a client error (e.g., malformed syntax).</p> 1880 1956 <div id="rfc.iref.40"></div> 1881 1957 <div id="rfc.iref.s.22"></div> 1882 <h3 id="rfc.section. 4.6.2"><a href="#rfc.section.4.6.2">4.6.2</a> <a id="status.402" href="#status.402">402 Payment Required</a></h3>1883 <p id="rfc.section. 4.6.2.p.1">This code is reserved for future use.</p>1958 <h3 id="rfc.section.5.6.2"><a href="#rfc.section.5.6.2">5.6.2</a> <a id="status.402" href="#status.402">402 Payment Required</a></h3> 1959 <p id="rfc.section.5.6.2.p.1">This code is reserved for future use.</p> 1884 1960 <div id="rfc.iref.41"></div> 1885 1961 <div id="rfc.iref.s.23"></div> 1886 <h3 id="rfc.section. 4.6.3"><a href="#rfc.section.4.6.3">4.6.3</a> <a id="status.403" href="#status.403">403 Forbidden</a></h3>1887 <p id="rfc.section. 4.6.3.p.1">The server understood the request, but refuses to authorize it. Providing different user authentication credentials might1962 <h3 id="rfc.section.5.6.3"><a href="#rfc.section.5.6.3">5.6.3</a> <a id="status.403" href="#status.403">403 Forbidden</a></h3> 1963 <p id="rfc.section.5.6.3.p.1">The server understood the request, but refuses to authorize it. Providing different user authentication credentials might 1888 1964 be successful, but any credentials that were provided in the request are insufficient. The request <em class="bcp14">SHOULD NOT</em> be repeated with the same credentials. 1889 1965 </p> 1890 <p id="rfc.section. 4.6.3.p.2">If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it <em class="bcp14">SHOULD</em> describe the reason for the refusal in the representation. If the server does not wish to make this information available1966 <p id="rfc.section.5.6.3.p.2">If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it <em class="bcp14">SHOULD</em> describe the reason for the refusal in the representation. If the server does not wish to make this information available 1891 1967 to the client, the status code <a href="#status.404" class="smpl">404 1892 1968 (Not Found)</a> <em class="bcp14">MAY</em> be used instead. … … 1894 1970 <div id="rfc.iref.42"></div> 1895 1971 <div id="rfc.iref.s.24"></div> 1896 <h3 id="rfc.section. 4.6.4"><a href="#rfc.section.4.6.4">4.6.4</a> <a id="status.404" href="#status.404">404 Not Found</a></h3>1897 <p id="rfc.section. 4.6.4.p.1">The server has not found anything matching the effective request URI. No indication is given of whether the condition is temporary1972 <h3 id="rfc.section.5.6.4"><a href="#rfc.section.5.6.4">5.6.4</a> <a id="status.404" href="#status.404">404 Not Found</a></h3> 1973 <p id="rfc.section.5.6.4.p.1">The server has not found anything matching the effective request URI. No indication is given of whether the condition is temporary 1898 1974 or permanent. The <a href="#status.410" class="smpl">410 (Gone)</a> status code <em class="bcp14">SHOULD</em> be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable 1899 1975 and has no forwarding address. This status code is commonly used when the server does not wish to reveal exactly why the request … … 1902 1978 <div id="rfc.iref.43"></div> 1903 1979 <div id="rfc.iref.s.25"></div> 1904 <h3 id="rfc.section. 4.6.5"><a href="#rfc.section.4.6.5">4.6.5</a> <a id="status.405" href="#status.405">405 Method Not Allowed</a></h3>1905 <p id="rfc.section. 4.6.5.p.1">The method specified in the request-line is not allowed for the target resource. The response <em class="bcp14">MUST</em> include an <a href="#header.allow" class="smpl">Allow</a> header field containing a list of valid methods for the requested resource.1980 <h3 id="rfc.section.5.6.5"><a href="#rfc.section.5.6.5">5.6.5</a> <a id="status.405" href="#status.405">405 Method Not Allowed</a></h3> 1981 <p id="rfc.section.5.6.5.p.1">The method specified in the request-line is not allowed for the target resource. The response <em class="bcp14">MUST</em> include an <a href="#header.allow" class="smpl">Allow</a> header field containing a list of valid methods for the requested resource. 1906 1982 </p> 1907 1983 <div id="rfc.iref.44"></div> 1908 1984 <div id="rfc.iref.s.26"></div> 1909 <h3 id="rfc.section. 4.6.6"><a href="#rfc.section.4.6.6">4.6.6</a> <a id="status.406" href="#status.406">406 Not Acceptable</a></h3>1910 <p id="rfc.section. 4.6.6.p.1">The resource identified by the request is only capable of generating response representations which have content characteristics1985 <h3 id="rfc.section.5.6.6"><a href="#rfc.section.5.6.6">5.6.6</a> <a id="status.406" href="#status.406">406 Not Acceptable</a></h3> 1986 <p id="rfc.section.5.6.6.p.1">The resource identified by the request is only capable of generating response representations which have content characteristics 1911 1987 not acceptable according to the <a href="#header.accept" class="smpl">Accept</a> and Accept-* header fields sent in the request. 1912 1988 </p> 1913 <p id="rfc.section. 4.6.6.p.2">Unless it was a HEAD request, the response <em class="bcp14">SHOULD</em> include a representation containing a list of available representation characteristics and location(s) from which the user1989 <p id="rfc.section.5.6.6.p.2">Unless it was a HEAD request, the response <em class="bcp14">SHOULD</em> include a representation containing a list of available representation characteristics and location(s) from which the user 1914 1990 or user agent can choose the one most appropriate. Depending upon the format and the capabilities of the user agent, selection 1915 1991 of the most appropriate choice <em class="bcp14">MAY</em> be performed automatically. However, this specification does not define any standard for such automatic selection. 1916 1992 </p> 1917 <div class="note" id="rfc.section. 4.6.6.p.3">1993 <div class="note" id="rfc.section.5.6.6.p.3"> 1918 1994 <p> <b>Note:</b> HTTP/1.1 servers are allowed to return responses which are not acceptable according to the accept header fields sent in the 1919 1995 request. In some cases, this might even be preferable to sending a 406 response. User agents are encouraged to inspect the … … 1921 1997 </p> 1922 1998 </div> 1923 <p id="rfc.section. 4.6.6.p.4">If the response could be unacceptable, a user agent <em class="bcp14">SHOULD</em> temporarily stop receipt of more data and query the user for a decision on further actions.1999 <p id="rfc.section.5.6.6.p.4">If the response could be unacceptable, a user agent <em class="bcp14">SHOULD</em> temporarily stop receipt of more data and query the user for a decision on further actions. 1924 2000 </p> 1925 2001 <div id="rfc.iref.45"></div> 1926 2002 <div id="rfc.iref.s.27"></div> 1927 <h3 id="rfc.section. 4.6.7"><a href="#rfc.section.4.6.7">4.6.7</a> <a id="status.408" href="#status.408">408 Request Timeout</a></h3>1928 <p id="rfc.section. 4.6.7.p.1">The client did not produce a request within the time that the server was prepared to wait. The client <em class="bcp14">MAY</em> repeat the request without modifications at any later time.2003 <h3 id="rfc.section.5.6.7"><a href="#rfc.section.5.6.7">5.6.7</a> <a id="status.408" href="#status.408">408 Request Timeout</a></h3> 2004 <p id="rfc.section.5.6.7.p.1">The client did not produce a request within the time that the server was prepared to wait. The client <em class="bcp14">MAY</em> repeat the request without modifications at any later time. 1929 2005 </p> 1930 2006 <div id="rfc.iref.46"></div> 1931 2007 <div id="rfc.iref.s.28"></div> 1932 <h3 id="rfc.section. 4.6.8"><a href="#rfc.section.4.6.8">4.6.8</a> <a id="status.409" href="#status.409">409 Conflict</a></h3>1933 <p id="rfc.section. 4.6.8.p.1">The request could not be completed due to a conflict with the current state of the resource. This code is only allowed in2008 <h3 id="rfc.section.5.6.8"><a href="#rfc.section.5.6.8">5.6.8</a> <a id="status.409" href="#status.409">409 Conflict</a></h3> 2009 <p id="rfc.section.5.6.8.p.1">The request could not be completed due to a conflict with the current state of the resource. This code is only allowed in 1934 2010 situations where it is expected that the user might be able to resolve the conflict and resubmit the request. The response 1935 2011 body <em class="bcp14">SHOULD</em> include enough information for the user to recognize the source of the conflict. Ideally, the response representation would 1936 2012 include enough information for the user or user agent to fix the problem; however, that might not be possible and is not required. 1937 2013 </p> 1938 <p id="rfc.section. 4.6.8.p.2">Conflicts are most likely to occur in response to a PUT request. For example, if versioning were being used and the representation2014 <p id="rfc.section.5.6.8.p.2">Conflicts are most likely to occur in response to a PUT request. For example, if versioning were being used and the representation 1939 2015 being PUT included changes to a resource which conflict with those made by an earlier (third-party) request, the server might 1940 2016 use the 409 response to indicate that it can't complete the request. In this case, the response representation would likely … … 1943 2019 <div id="rfc.iref.47"></div> 1944 2020 <div id="rfc.iref.s.29"></div> 1945 <h3 id="rfc.section. 4.6.9"><a href="#rfc.section.4.6.9">4.6.9</a> <a id="status.410" href="#status.410">410 Gone</a></h3>1946 <p id="rfc.section. 4.6.9.p.1">The target resource is no longer available at the server and no forwarding address is known. This condition is expected to2021 <h3 id="rfc.section.5.6.9"><a href="#rfc.section.5.6.9">5.6.9</a> <a id="status.410" href="#status.410">410 Gone</a></h3> 2022 <p id="rfc.section.5.6.9.p.1">The target resource is no longer available at the server and no forwarding address is known. This condition is expected to 1947 2023 be considered permanent. Clients with link editing capabilities <em class="bcp14">SHOULD</em> delete references to the effective request URI after user approval. If the server does not know, or has no facility to determine, 1948 2024 whether or not the condition is permanent, the status code <a href="#status.404" class="smpl">404 (Not Found)</a> <em class="bcp14">SHOULD</em> be used instead. 1949 2025 </p> 1950 <p id="rfc.section. 4.6.9.p.2">The 410 response is primarily intended to assist the task of web maintenance by notifying the recipient that the resource2026 <p id="rfc.section.5.6.9.p.2">The 410 response is primarily intended to assist the task of web maintenance by notifying the recipient that the resource 1951 2027 is intentionally unavailable and that the server owners desire that remote links to that resource be removed. Such an event 1952 2028 is common for limited-time, promotional services and for resources belonging to individuals no longer working at the server's … … 1954 2030 — that is left to the discretion of the server owner. 1955 2031 </p> 1956 <p id="rfc.section. 4.6.9.p.3">Caches <em class="bcp14">MAY</em> use a heuristic (see <a href="p6-cache.html#heuristic.freshness" title="Calculating Heuristic Freshness">Section 4.1.2</a> of <a href="#Part6" id="rfc.xref.Part6.17"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>) to determine freshness for 410 responses.2032 <p id="rfc.section.5.6.9.p.3">Caches <em class="bcp14">MAY</em> use a heuristic (see <a href="p6-cache.html#heuristic.freshness" title="Calculating Heuristic Freshness">Section 4.1.2</a> of <a href="#Part6" id="rfc.xref.Part6.17"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>) to determine freshness for 410 responses. 1957 2033 </p> 1958 2034 <div id="rfc.iref.48"></div> 1959 2035 <div id="rfc.iref.s.30"></div> 1960 <h3 id="rfc.section. 4.6.10"><a href="#rfc.section.4.6.10">4.6.10</a> <a id="status.411" href="#status.411">411 Length Required</a></h3>1961 <p id="rfc.section. 4.6.10.p.1">The server refuses to accept the request without a defined <a href="p1-messaging.html#header.content-length" class="smpl">Content-Length</a>. The client <em class="bcp14">MAY</em> repeat the request if it adds a valid Content-Length header field containing the length of the message body in the request2036 <h3 id="rfc.section.5.6.10"><a href="#rfc.section.5.6.10">5.6.10</a> <a id="status.411" href="#status.411">411 Length Required</a></h3> 2037 <p id="rfc.section.5.6.10.p.1">The server refuses to accept the request without a defined <a href="p1-messaging.html#header.content-length" class="smpl">Content-Length</a>. The client <em class="bcp14">MAY</em> repeat the request if it adds a valid Content-Length header field containing the length of the message body in the request 1962 2038 message. 1963 2039 </p> 1964 2040 <div id="rfc.iref.49"></div> 1965 2041 <div id="rfc.iref.s.31"></div> 1966 <h3 id="rfc.section. 4.6.11"><a href="#rfc.section.4.6.11">4.6.11</a> <a id="status.413" href="#status.413">413 Request Representation Too Large</a></h3>1967 <p id="rfc.section. 4.6.11.p.1">The server is refusing to process a request because the request representation is larger than the server is willing or able2042 <h3 id="rfc.section.5.6.11"><a href="#rfc.section.5.6.11">5.6.11</a> <a id="status.413" href="#status.413">413 Request Representation Too Large</a></h3> 2043 <p id="rfc.section.5.6.11.p.1">The server is refusing to process a request because the request representation is larger than the server is willing or able 1968 2044 to process. The server <em class="bcp14">MAY</em> close the connection to prevent the client from continuing the request. 1969 2045 </p> 1970 <p id="rfc.section. 4.6.11.p.2">If the condition is temporary, the server <em class="bcp14">SHOULD</em> include a <a href="#header.retry-after" class="smpl">Retry-After</a> header field to indicate that it is temporary and after what time the client <em class="bcp14">MAY</em> try again.2046 <p id="rfc.section.5.6.11.p.2">If the condition is temporary, the server <em class="bcp14">SHOULD</em> include a <a href="#header.retry-after" class="smpl">Retry-After</a> header field to indicate that it is temporary and after what time the client <em class="bcp14">MAY</em> try again. 1971 2047 </p> 1972 2048 <div id="rfc.iref.50"></div> 1973 2049 <div id="rfc.iref.s.32"></div> 1974 <h3 id="rfc.section. 4.6.12"><a href="#rfc.section.4.6.12">4.6.12</a> <a id="status.414" href="#status.414">414 URI Too Long</a></h3>1975 <p id="rfc.section. 4.6.12.p.1">The server is refusing to service the request because the effective request URI is longer than the server is willing to interpret.2050 <h3 id="rfc.section.5.6.12"><a href="#rfc.section.5.6.12">5.6.12</a> <a id="status.414" href="#status.414">414 URI Too Long</a></h3> 2051 <p id="rfc.section.5.6.12.p.1">The server is refusing to service the request because the effective request URI is longer than the server is willing to interpret. 1976 2052 This rare condition is only likely to occur when a client has improperly converted a POST request to a GET request with long 1977 2053 query information, when the client has descended into a URI "black hole" of redirection (e.g., a redirected URI prefix that … … 1981 2057 <div id="rfc.iref.51"></div> 1982 2058 <div id="rfc.iref.s.33"></div> 1983 <h3 id="rfc.section. 4.6.13"><a href="#rfc.section.4.6.13">4.6.13</a> <a id="status.415" href="#status.415">415 Unsupported Media Type</a></h3>1984 <p id="rfc.section. 4.6.13.p.1">The server is refusing to service the request because the request payload is in a format not supported by this request method2059 <h3 id="rfc.section.5.6.13"><a href="#rfc.section.5.6.13">5.6.13</a> <a id="status.415" href="#status.415">415 Unsupported Media Type</a></h3> 2060 <p id="rfc.section.5.6.13.p.1">The server is refusing to service the request because the request payload is in a format not supported by this request method 1985 2061 on the target resource. 1986 2062 </p> 1987 2063 <div id="rfc.iref.52"></div> 1988 2064 <div id="rfc.iref.s.34"></div> 1989 <h3 id="rfc.section. 4.6.14"><a href="#rfc.section.4.6.14">4.6.14</a> <a id="status.417" href="#status.417">417 Expectation Failed</a></h3>1990 <p id="rfc.section. 4.6.14.p.1">The expectation given in an <a href="#header.expect" class="smpl">Expect</a> header field (see <a href="#header.expect" id="rfc.xref.header.expect.2" title="Expect">Section 9.11</a>) could not be met by this server, or, if the server is a proxy, the server has unambiguous evidence that the request could2065 <h3 id="rfc.section.5.6.14"><a href="#rfc.section.5.6.14">5.6.14</a> <a id="status.417" href="#status.417">417 Expectation Failed</a></h3> 2066 <p id="rfc.section.5.6.14.p.1">The expectation given in an <a href="#header.expect" class="smpl">Expect</a> header field (see <a href="#header.expect" id="rfc.xref.header.expect.2" title="Expect">Section 10.11</a>) could not be met by this server, or, if the server is a proxy, the server has unambiguous evidence that the request could 1991 2067 not be met by the next-hop server. 1992 2068 </p> 1993 2069 <div id="rfc.iref.53"></div> 1994 2070 <div id="rfc.iref.s.35"></div> 1995 <h3 id="rfc.section. 4.6.15"><a href="#rfc.section.4.6.15">4.6.15</a> <a id="status.426" href="#status.426">426 Upgrade Required</a></h3>1996 <p id="rfc.section. 4.6.15.p.1">The request can not be completed without a prior protocol upgrade. This response <em class="bcp14">MUST</em> include an <a href="p1-messaging.html#header.upgrade" class="smpl">Upgrade</a> header field (<a href="p1-messaging.html#header.upgrade" title="Upgrade">Section 6.5</a> of <a href="#Part1" id="rfc.xref.Part1.23"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>) specifying the required protocols.2071 <h3 id="rfc.section.5.6.15"><a href="#rfc.section.5.6.15">5.6.15</a> <a id="status.426" href="#status.426">426 Upgrade Required</a></h3> 2072 <p id="rfc.section.5.6.15.p.1">The request can not be completed without a prior protocol upgrade. This response <em class="bcp14">MUST</em> include an <a href="p1-messaging.html#header.upgrade" class="smpl">Upgrade</a> header field (<a href="p1-messaging.html#header.upgrade" title="Upgrade">Section 6.4</a> of <a href="#Part1" id="rfc.xref.Part1.25"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>) specifying the required protocols. 1997 2073 </p> 1998 2074 <div id="rfc.figure.u.5"></div> … … 2004 2080 2005 2081 <span id="s426body">This service requires use of the HTTP/3.0 protocol. 2006 </span></pre><p id="rfc.section. 4.6.15.p.3">The server <em class="bcp14">SHOULD</em> include a message body in the 426 response which indicates in human readable form the reason for the error and describes any2082 </span></pre><p id="rfc.section.5.6.15.p.3">The server <em class="bcp14">SHOULD</em> include a message body in the 426 response which indicates in human readable form the reason for the error and describes any 2007 2083 alternative courses which might be available to the user. 2008 2084 </p> 2009 <h2 id="rfc.section. 4.7"><a href="#rfc.section.4.7">4.7</a> <a id="status.5xx" href="#status.5xx">Server Error 5xx</a></h2>2085 <h2 id="rfc.section.5.7"><a href="#rfc.section.5.7">5.7</a> <a id="status.5xx" href="#status.5xx">Server Error 5xx</a></h2> 2010 2086 <div id="rfc.iref.54"></div> 2011 2087 <div id="rfc.iref.s.36"></div> 2012 <p id="rfc.section. 4.7.p.1">Response status codes beginning with the digit "5" indicate cases in which the server is aware that it has erred or is incapable2088 <p id="rfc.section.5.7.p.1">Response status codes beginning with the digit "5" indicate cases in which the server is aware that it has erred or is incapable 2013 2089 of performing the request. Except when responding to a HEAD request, the server <em class="bcp14">SHOULD</em> include a representation containing an explanation of the error situation, and whether it is a temporary or permanent condition. 2014 2090 User agents <em class="bcp14">SHOULD</em> display any included representation to the user. These response codes are applicable to any request method. … … 2016 2092 <div id="rfc.iref.55"></div> 2017 2093 <div id="rfc.iref.s.37"></div> 2018 <h3 id="rfc.section. 4.7.1"><a href="#rfc.section.4.7.1">4.7.1</a> <a id="status.500" href="#status.500">500 Internal Server Error</a></h3>2019 <p id="rfc.section. 4.7.1.p.1">The server encountered an unexpected condition which prevented it from fulfilling the request.</p>2094 <h3 id="rfc.section.5.7.1"><a href="#rfc.section.5.7.1">5.7.1</a> <a id="status.500" href="#status.500">500 Internal Server Error</a></h3> 2095 <p id="rfc.section.5.7.1.p.1">The server encountered an unexpected condition which prevented it from fulfilling the request.</p> 2020 2096 <div id="rfc.iref.56"></div> 2021 2097 <div id="rfc.iref.s.38"></div> 2022 <h3 id="rfc.section. 4.7.2"><a href="#rfc.section.4.7.2">4.7.2</a> <a id="status.501" href="#status.501">501 Not Implemented</a></h3>2023 <p id="rfc.section. 4.7.2.p.1">The server does not support the functionality required to fulfill the request. This is the appropriate response when the server2098 <h3 id="rfc.section.5.7.2"><a href="#rfc.section.5.7.2">5.7.2</a> <a id="status.501" href="#status.501">501 Not Implemented</a></h3> 2099 <p id="rfc.section.5.7.2.p.1">The server does not support the functionality required to fulfill the request. This is the appropriate response when the server 2024 2100 does not recognize the request method and is not capable of supporting it for any resource. 2025 2101 </p> 2026 2102 <div id="rfc.iref.57"></div> 2027 2103 <div id="rfc.iref.s.39"></div> 2028 <h3 id="rfc.section. 4.7.3"><a href="#rfc.section.4.7.3">4.7.3</a> <a id="status.502" href="#status.502">502 Bad Gateway</a></h3>2029 <p id="rfc.section. 4.7.3.p.1">The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting2104 <h3 id="rfc.section.5.7.3"><a href="#rfc.section.5.7.3">5.7.3</a> <a id="status.502" href="#status.502">502 Bad Gateway</a></h3> 2105 <p id="rfc.section.5.7.3.p.1">The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting 2030 2106 to fulfill the request. 2031 2107 </p> 2032 2108 <div id="rfc.iref.58"></div> 2033 2109 <div id="rfc.iref.s.40"></div> 2034 <h3 id="rfc.section. 4.7.4"><a href="#rfc.section.4.7.4">4.7.4</a> <a id="status.503" href="#status.503">503 Service Unavailable</a></h3>2035 <p id="rfc.section. 4.7.4.p.1">The server is currently unable to handle the request due to a temporary overloading or maintenance of the server.</p>2036 <p id="rfc.section. 4.7.4.p.2">The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the2037 delay <em class="bcp14">MAY</em> be indicated in a <a href="#header.retry-after" class="smpl">Retry-After</a> header field (<a href="#header.retry-after" id="rfc.xref.header.retry-after.2" title="Retry-After">Section 9.16</a>). If no Retry-After is given, the client <em class="bcp14">SHOULD</em> handle the response as it would for a <a href="#status.500" class="smpl">500 (Internal2110 <h3 id="rfc.section.5.7.4"><a href="#rfc.section.5.7.4">5.7.4</a> <a id="status.503" href="#status.503">503 Service Unavailable</a></h3> 2111 <p id="rfc.section.5.7.4.p.1">The server is currently unable to handle the request due to a temporary overloading or maintenance of the server.</p> 2112 <p id="rfc.section.5.7.4.p.2">The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the 2113 delay <em class="bcp14">MAY</em> be indicated in a <a href="#header.retry-after" class="smpl">Retry-After</a> header field (<a href="#header.retry-after" id="rfc.xref.header.retry-after.2" title="Retry-After">Section 10.16</a>). If no Retry-After is given, the client <em class="bcp14">SHOULD</em> handle the response as it would for a <a href="#status.500" class="smpl">500 (Internal 2038 2114 Server Error)</a> response. 2039 2115 </p> 2040 <div class="note" id="rfc.section. 4.7.4.p.3">2116 <div class="note" id="rfc.section.5.7.4.p.3"> 2041 2117 <p> <b>Note:</b> The existence of the 503 status code does not imply that a server has to use it when becoming overloaded. Some servers might 2042 2118 wish to simply refuse the connection. … … 2045 2121 <div id="rfc.iref.59"></div> 2046 2122 <div id="rfc.iref.s.41"></div> 2047 <h3 id="rfc.section. 4.7.5"><a href="#rfc.section.4.7.5">4.7.5</a> <a id="status.504" href="#status.504">504 Gateway Timeout</a></h3>2048 <p id="rfc.section. 4.7.5.p.1">The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the2123 <h3 id="rfc.section.5.7.5"><a href="#rfc.section.5.7.5">5.7.5</a> <a id="status.504" href="#status.504">504 Gateway Timeout</a></h3> 2124 <p id="rfc.section.5.7.5.p.1">The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the 2049 2125 URI (e.g., HTTP, FTP, LDAP) or some other auxiliary server (e.g., DNS) it needed to access in attempting to complete the request. 2050 2126 </p> 2051 <div class="note" id="rfc.section. 4.7.5.p.2">2127 <div class="note" id="rfc.section.5.7.5.p.2"> 2052 2128 <p> <b>Note</b> to implementers: some deployed proxies are known to return <a href="#status.400" class="smpl">400 (Bad Request)</a> or <a href="#status.500" class="smpl">500 (Internal Server 2053 2129 Error)</a> when DNS lookups time out. … … 2056 2132 <div id="rfc.iref.60"></div> 2057 2133 <div id="rfc.iref.s.42"></div> 2058 <h3 id="rfc.section. 4.7.6"><a href="#rfc.section.4.7.6">4.7.6</a> <a id="status.505" href="#status.505">505 HTTP Version Not Supported</a></h3>2059 <p id="rfc.section. 4.7.6.p.1">The server does not support, or refuses to support, the protocol version that was used in the request message. The server2134 <h3 id="rfc.section.5.7.6"><a href="#rfc.section.5.7.6">5.7.6</a> <a id="status.505" href="#status.505">505 HTTP Version Not Supported</a></h3> 2135 <p id="rfc.section.5.7.6.p.1">The server does not support, or refuses to support, the protocol version that was used in the request message. The server 2060 2136 is indicating that it is unable or unwilling to complete the request using the same major version as the client, as described 2061 in <a href="p1-messaging.html#http.version" title="Protocol Versioning">Section 2. 7</a> of <a href="#Part1" id="rfc.xref.Part1.24"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>, other than with this error message. The response <em class="bcp14">SHOULD</em> contain a representation describing why that version is not supported and what other protocols are supported by that server.2062 </p> 2063 <h1 id="rfc.section. 5"><a href="#rfc.section.5">5.</a> <a id="protocol.parameters" href="#protocol.parameters">Protocol Parameters</a></h1>2064 <h2 id="rfc.section. 5.1"><a href="#rfc.section.5.1">5.1</a> <a id="http.date" href="#http.date">Date/Time Formats</a></h2>2065 <p id="rfc.section. 5.1.p.1">HTTP applications have historically allowed three different formats for date/time stamps. However, the preferred format is2137 in <a href="p1-messaging.html#http.version" title="Protocol Versioning">Section 2.6</a> of <a href="#Part1" id="rfc.xref.Part1.26"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>, other than with this error message. The response <em class="bcp14">SHOULD</em> contain a representation describing why that version is not supported and what other protocols are supported by that server. 2138 </p> 2139 <h1 id="rfc.section.6"><a href="#rfc.section.6">6.</a> <a id="protocol.parameters" href="#protocol.parameters">Protocol Parameters</a></h1> 2140 <h2 id="rfc.section.6.1"><a href="#rfc.section.6.1">6.1</a> <a id="http.date" href="#http.date">Date/Time Formats</a></h2> 2141 <p id="rfc.section.6.1.p.1">HTTP applications have historically allowed three different formats for date/time stamps. However, the preferred format is 2066 2142 a fixed-length subset of that defined by <a href="#RFC1123" id="rfc.xref.RFC1123.1"><cite title="Requirements for Internet Hosts - Application and Support">[RFC1123]</cite></a>: 2067 2143 </p> 2068 2144 <div id="rfc.figure.u.6"></div><pre class="text">Sun, 06 Nov 1994 08:49:37 GMT ; RFC 1123 2069 </pre><p id="rfc.section. 5.1.p.3">The other formats are described here only for compatibility with obsolete implementations.</p>2145 </pre><p id="rfc.section.6.1.p.3">The other formats are described here only for compatibility with obsolete implementations.</p> 2070 2146 <div id="rfc.figure.u.7"></div><pre class="text">Sunday, 06-Nov-94 08:49:37 GMT ; obsolete RFC 850 format 2071 2147 Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format 2072 </pre><p id="rfc.section. 5.1.p.5">HTTP/1.1 clients and servers that parse a date value <em class="bcp14">MUST</em> accept all three formats (for compatibility with HTTP/1.0), though they <em class="bcp14">MUST</em> only generate the RFC 1123 format for representing HTTP-date values in header fields.2073 </p> 2074 <p id="rfc.section. 5.1.p.6">All HTTP date/time stamps <em class="bcp14">MUST</em> be represented in Greenwich Mean Time (GMT), without exception. For the purposes of HTTP, GMT is exactly equal to UTC (Coordinated2148 </pre><p id="rfc.section.6.1.p.5">HTTP/1.1 clients and servers that parse a date value <em class="bcp14">MUST</em> accept all three formats (for compatibility with HTTP/1.0), though they <em class="bcp14">MUST</em> only generate the RFC 1123 format for representing HTTP-date values in header fields. 2149 </p> 2150 <p id="rfc.section.6.1.p.6">All HTTP date/time stamps <em class="bcp14">MUST</em> be represented in Greenwich Mean Time (GMT), without exception. For the purposes of HTTP, GMT is exactly equal to UTC (Coordinated 2075 2151 Universal Time). This is indicated in the first two formats by the inclusion of "GMT" as the three-letter abbreviation for 2076 2152 time zone, and <em class="bcp14">MUST</em> be assumed when reading the asctime format. HTTP-date is case sensitive and <em class="bcp14">MUST NOT</em> include additional whitespace beyond that specifically included as SP in the grammar. … … 2078 2154 <div id="rfc.figure.u.8"></div><pre class="inline"><span id="rfc.iref.g.3"></span> <a href="#http.date" class="smpl">HTTP-date</a> = <a href="#preferred.date.format" class="smpl">rfc1123-date</a> / <a href="#obsolete.date.formats" class="smpl">obs-date</a> 2079 2155 </pre><div id="preferred.date.format"> 2080 <p id="rfc.section. 5.1.p.8"> Preferred format:</p>2156 <p id="rfc.section.6.1.p.8"> Preferred format:</p> 2081 2157 </div> 2082 2158 <div id="rfc.figure.u.9"></div><pre class="inline"><span id="rfc.iref.g.4"></span><span id="rfc.iref.g.5"></span><span id="rfc.iref.g.6"></span><span id="rfc.iref.g.7"></span><span id="rfc.iref.g.8"></span><span id="rfc.iref.g.9"></span><span id="rfc.iref.g.10"></span><span id="rfc.iref.g.11"></span><span id="rfc.iref.g.12"></span><span id="rfc.iref.g.13"></span><span id="rfc.iref.g.14"></span><span id="rfc.iref.g.15"></span> <a href="#preferred.date.format" class="smpl">rfc1123-date</a> = <a href="#preferred.date.format" class="smpl">day-name</a> "," <a href="#imported.abnf" class="smpl">SP</a> date1 <a href="#imported.abnf" class="smpl">SP</a> <a href="#preferred.date.format" class="smpl">time-of-day</a> <a href="#imported.abnf" class="smpl">SP</a> <a href="#preferred.date.format" class="smpl">GMT</a> … … 2118 2194 <a href="#preferred.date.format" class="smpl">minute</a> = 2<a href="#imported.abnf" class="smpl">DIGIT</a> 2119 2195 <a href="#preferred.date.format" class="smpl">second</a> = 2<a href="#imported.abnf" class="smpl">DIGIT</a> 2120 </pre><p id="rfc.section. 5.1.p.10">The semantics of <a href="#preferred.date.format" class="smpl">day-name</a>, <a href="#preferred.date.format" class="smpl">day</a>, <a href="#preferred.date.format" class="smpl">month</a>, <a href="#preferred.date.format" class="smpl">year</a>, and <a href="#preferred.date.format" class="smpl">time-of-day</a> are the same as those defined for the RFC 5322 constructs with the corresponding name (<a href="#RFC5322" id="rfc.xref.RFC5322.1"><cite title="Internet Message Format">[RFC5322]</cite></a>, <a href="http://tools.ietf.org/html/rfc5322#section-3.3">Section 3.3</a>).2196 </pre><p id="rfc.section.6.1.p.10">The semantics of <a href="#preferred.date.format" class="smpl">day-name</a>, <a href="#preferred.date.format" class="smpl">day</a>, <a href="#preferred.date.format" class="smpl">month</a>, <a href="#preferred.date.format" class="smpl">year</a>, and <a href="#preferred.date.format" class="smpl">time-of-day</a> are the same as those defined for the RFC 5322 constructs with the corresponding name (<a href="#RFC5322" id="rfc.xref.RFC5322.1"><cite title="Internet Message Format">[RFC5322]</cite></a>, <a href="http://tools.ietf.org/html/rfc5322#section-3.3">Section 3.3</a>). 2121 2197 </p> 2122 2198 <div id="obsolete.date.formats"> 2123 <p id="rfc.section. 5.1.p.11"> Obsolete formats:</p>2199 <p id="rfc.section.6.1.p.11"> Obsolete formats:</p> 2124 2200 </div> 2125 2201 <div id="rfc.figure.u.10"></div><pre class="inline"><span id="rfc.iref.g.16"></span> <a href="#obsolete.date.formats" class="smpl">obs-date</a> = <a href="#obsolete.date.formats" class="smpl">rfc850-date</a> / <a href="#obsolete.date.formats" class="smpl">asctime-date</a> … … 2138 2214 <a href="#obsolete.date.formats" class="smpl">date3</a> = <a href="#preferred.date.format" class="smpl">month</a> <a href="#imported.abnf" class="smpl">SP</a> ( 2<a href="#imported.abnf" class="smpl">DIGIT</a> / ( <a href="#imported.abnf" class="smpl">SP</a> 1<a href="#imported.abnf" class="smpl">DIGIT</a> )) 2139 2215 ; month day (e.g., Jun 2) 2140 </pre><div class="note" id="rfc.section. 5.1.p.15">2216 </pre><div class="note" id="rfc.section.6.1.p.15"> 2141 2217 <p> <b>Note:</b> Recipients of date values are encouraged to be robust in accepting date values that might have been sent by non-HTTP applications, 2142 2218 as is sometimes the case when retrieving or posting messages via proxies/gateways to SMTP or NNTP. 2143 2219 </p> 2144 2220 </div> 2145 <div class="note" id="rfc.section. 5.1.p.16">2221 <div class="note" id="rfc.section.6.1.p.16"> 2146 2222 <p> <b>Note:</b> HTTP requirements for the date/time stamp format apply only to their usage within the protocol stream. Clients and servers 2147 2223 are not required to use these formats for user presentation, request logging, etc. 2148 2224 </p> 2149 2225 </div> 2150 <h2 id="rfc.section. 5.2"><a href="#rfc.section.5.2">5.2</a> <a id="product.tokens" href="#product.tokens">Product Tokens</a></h2>2151 <p id="rfc.section. 5.2.p.1">Product tokens are used to allow communicating applications to identify themselves by software name and version. Most fields2226 <h2 id="rfc.section.6.2"><a href="#rfc.section.6.2">6.2</a> <a id="product.tokens" href="#product.tokens">Product Tokens</a></h2> 2227 <p id="rfc.section.6.2.p.1">Product tokens are used to allow communicating applications to identify themselves by software name and version. Most fields 2152 2228 using product tokens also allow sub-products which form a significant part of the application to be listed, separated by whitespace. 2153 2229 By convention, the products are listed in order of their significance for identifying the application. … … 2155 2231 <div id="rfc.figure.u.13"></div><pre class="inline"><span id="rfc.iref.g.19"></span><span id="rfc.iref.g.20"></span> <a href="#product.tokens" class="smpl">product</a> = <a href="#imported.abnf" class="smpl">token</a> ["/" <a href="#product.tokens" class="smpl">product-version</a>] 2156 2232 <a href="#product.tokens" class="smpl">product-version</a> = <a href="#imported.abnf" class="smpl">token</a> 2157 </pre><p id="rfc.section. 5.2.p.3">Examples:</p>2233 </pre><p id="rfc.section.6.2.p.3">Examples:</p> 2158 2234 <div id="rfc.figure.u.14"></div><pre class="text"> User-Agent: CERN-LineMode/2.15 libwww/2.17b3 2159 2235 Server: Apache/0.8.4 2160 </pre><p id="rfc.section. 5.2.p.5">Product tokens <em class="bcp14">SHOULD</em> be short and to the point. They <em class="bcp14">MUST NOT</em> be used for advertising or other non-essential information. Although any token octet <em class="bcp14">MAY</em> appear in a product-version, this token <em class="bcp14">SHOULD</em> only be used for a version identifier (i.e., successive versions of the same product <em class="bcp14">SHOULD</em> only differ in the product-version portion of the product value).2161 </p> 2162 <h2 id="rfc.section. 5.3"><a href="#rfc.section.5.3">5.3</a> <a id="character.sets" href="#character.sets">Character Encodings (charset)</a></h2>2163 <p id="rfc.section. 5.3.p.1">HTTP uses charset names to indicate the character encoding of a textual representation.</p>2236 </pre><p id="rfc.section.6.2.p.5">Product tokens <em class="bcp14">SHOULD</em> be short and to the point. They <em class="bcp14">MUST NOT</em> be used for advertising or other non-essential information. Although any token octet <em class="bcp14">MAY</em> appear in a product-version, this token <em class="bcp14">SHOULD</em> only be used for a version identifier (i.e., successive versions of the same product <em class="bcp14">SHOULD</em> only differ in the product-version portion of the product value). 2237 </p> 2238 <h2 id="rfc.section.6.3"><a href="#rfc.section.6.3">6.3</a> <a id="character.sets" href="#character.sets">Character Encodings (charset)</a></h2> 2239 <p id="rfc.section.6.3.p.1">HTTP uses charset names to indicate the character encoding of a textual representation.</p> 2164 2240 <div id="rule.charset"> 2165 <p id="rfc.section. 5.3.p.2"> A character encoding is identified by a case-insensitive token. The complete set of tokens is defined by the IANA Character2241 <p id="rfc.section.6.3.p.2"> A character encoding is identified by a case-insensitive token. The complete set of tokens is defined by the IANA Character 2166 2242 Set registry (<<a href="http://www.iana.org/assignments/character-sets">http://www.iana.org/assignments/character-sets</a>>). 2167 2243 </p> 2168 2244 </div> 2169 2245 <div id="rfc.figure.u.15"></div><pre class="inline"><span id="rfc.iref.g.21"></span> <a href="#rule.charset" class="smpl">charset</a> = <a href="#imported.abnf" class="smpl">token</a> 2170 </pre><p id="rfc.section. 5.3.p.4">Although HTTP allows an arbitrary token to be used as a charset value, any token that has a predefined value within the IANA2246 </pre><p id="rfc.section.6.3.p.4">Although HTTP allows an arbitrary token to be used as a charset value, any token that has a predefined value within the IANA 2171 2247 Character Set registry <em class="bcp14">MUST</em> represent the character encoding defined by that registry. Applications <em class="bcp14">SHOULD</em> limit their use of character encodings to those defined within the IANA registry. 2172 2248 </p> 2173 <p id="rfc.section. 5.3.p.5">HTTP uses charset in two contexts: within an <a href="#header.accept-charset" class="smpl">Accept-Charset</a> request header field (in which the charset value is an unquoted token) and as the value of a parameter in a <a href="#header.content-type" class="smpl">Content-Type</a> header field (within a request or response), in which case the parameter value of the charset parameter can be quoted.2174 </p> 2175 <p id="rfc.section. 5.3.p.6">Implementers need to be aware of IETF character set requirements <a href="#RFC3629" id="rfc.xref.RFC3629.1"><cite title="UTF-8, a transformation format of ISO 10646">[RFC3629]</cite></a> <a href="#RFC2277" id="rfc.xref.RFC2277.1"><cite title="IETF Policy on Character Sets and Languages">[RFC2277]</cite></a>.2176 </p> 2177 <h2 id="rfc.section. 5.4"><a href="#rfc.section.5.4">5.4</a> <a id="content.codings" href="#content.codings">Content Codings</a></h2>2178 <p id="rfc.section. 5.4.p.1">Content coding values indicate an encoding transformation that has been or can be applied to a representation. Content codings2249 <p id="rfc.section.6.3.p.5">HTTP uses charset in two contexts: within an <a href="#header.accept-charset" class="smpl">Accept-Charset</a> request header field (in which the charset value is an unquoted token) and as the value of a parameter in a <a href="#header.content-type" class="smpl">Content-Type</a> header field (within a request or response), in which case the parameter value of the charset parameter can be quoted. 2250 </p> 2251 <p id="rfc.section.6.3.p.6">Implementers need to be aware of IETF character set requirements <a href="#RFC3629" id="rfc.xref.RFC3629.1"><cite title="UTF-8, a transformation format of ISO 10646">[RFC3629]</cite></a> <a href="#RFC2277" id="rfc.xref.RFC2277.1"><cite title="IETF Policy on Character Sets and Languages">[RFC2277]</cite></a>. 2252 </p> 2253 <h2 id="rfc.section.6.4"><a href="#rfc.section.6.4">6.4</a> <a id="content.codings" href="#content.codings">Content Codings</a></h2> 2254 <p id="rfc.section.6.4.p.1">Content coding values indicate an encoding transformation that has been or can be applied to a representation. Content codings 2179 2255 are primarily used to allow a representation to be compressed or otherwise usefully transformed without losing the identity 2180 2256 of its underlying media type and without loss of information. Frequently, the representation is stored in coded form, transmitted … … 2182 2258 </p> 2183 2259 <div id="rfc.figure.u.16"></div><pre class="inline"><span id="rfc.iref.g.22"></span> <a href="#content.codings" class="smpl">content-coding</a> = <a href="#imported.abnf" class="smpl">token</a> 2184 </pre><p id="rfc.section. 5.4.p.3">All content-coding values are case-insensitive. HTTP/1.1 uses content-coding values in the <a href="#header.accept-encoding" class="smpl">Accept-Encoding</a> (<a href="#header.accept-encoding" id="rfc.xref.header.accept-encoding.2" title="Accept-Encoding">Section 9.3</a>) and <a href="#header.content-encoding" class="smpl">Content-Encoding</a> (<a href="#header.content-encoding" id="rfc.xref.header.content-encoding.1" title="Content-Encoding">Section 9.6</a>) header fields. Although the value describes the content-coding, what is more important is that it indicates what decoding2260 </pre><p id="rfc.section.6.4.p.3">All content-coding values are case-insensitive. HTTP/1.1 uses content-coding values in the <a href="#header.accept-encoding" class="smpl">Accept-Encoding</a> (<a href="#header.accept-encoding" id="rfc.xref.header.accept-encoding.2" title="Accept-Encoding">Section 10.3</a>) and <a href="#header.content-encoding" class="smpl">Content-Encoding</a> (<a href="#header.content-encoding" id="rfc.xref.header.content-encoding.1" title="Content-Encoding">Section 10.6</a>) header fields. Although the value describes the content-coding, what is more important is that it indicates what decoding 2185 2261 mechanism will be required to remove the encoding. 2186 2262 </p> 2187 <p id="rfc.section. 5.4.p.4">compress<span id="rfc.iref.c.3"></span><span id="rfc.iref.c.4"></span>2263 <p id="rfc.section.6.4.p.4">compress<span id="rfc.iref.c.3"></span><span id="rfc.iref.c.4"></span> 2188 2264 </p> 2189 2265 <ul class="empty"> 2190 <li>See <a href="p1-messaging.html#compress.coding" title="Compress Coding">Section 4.2.1</a> of <a href="#Part1" id="rfc.xref.Part1.2 5"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>.2191 </li> 2192 </ul> 2193 <p id="rfc.section. 5.4.p.5">deflate<span id="rfc.iref.d.2"></span><span id="rfc.iref.c.5"></span>2266 <li>See <a href="p1-messaging.html#compress.coding" title="Compress Coding">Section 4.2.1</a> of <a href="#Part1" id="rfc.xref.Part1.27"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>. 2267 </li> 2268 </ul> 2269 <p id="rfc.section.6.4.p.5">deflate<span id="rfc.iref.d.2"></span><span id="rfc.iref.c.5"></span> 2194 2270 </p> 2195 2271 <ul class="empty"> 2196 <li>See <a href="p1-messaging.html#deflate.coding" title="Deflate Coding">Section 4.2.2</a> of <a href="#Part1" id="rfc.xref.Part1.2 6"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>.2197 </li> 2198 </ul> 2199 <p id="rfc.section. 5.4.p.6">gzip<span id="rfc.iref.g.23"></span><span id="rfc.iref.c.6"></span>2272 <li>See <a href="p1-messaging.html#deflate.coding" title="Deflate Coding">Section 4.2.2</a> of <a href="#Part1" id="rfc.xref.Part1.28"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>. 2273 </li> 2274 </ul> 2275 <p id="rfc.section.6.4.p.6">gzip<span id="rfc.iref.g.23"></span><span id="rfc.iref.c.6"></span> 2200 2276 </p> 2201 2277 <ul class="empty"> 2202 <li>See <a href="p1-messaging.html#gzip.coding" title="Gzip Coding">Section 4.2.3</a> of <a href="#Part1" id="rfc.xref.Part1.2 7"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>.2203 </li> 2204 </ul> 2205 <h3 id="rfc.section. 5.4.1"><a href="#rfc.section.5.4.1">5.4.1</a> <a id="content.coding.registry" href="#content.coding.registry">Content Coding Registry</a></h3>2206 <p id="rfc.section. 5.4.1.p.1">The HTTP Content Coding Registry defines the name space for the content coding names.</p>2207 <p id="rfc.section. 5.4.1.p.2">Registrations <em class="bcp14">MUST</em> include the following fields:2278 <li>See <a href="p1-messaging.html#gzip.coding" title="Gzip Coding">Section 4.2.3</a> of <a href="#Part1" id="rfc.xref.Part1.29"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>. 2279 </li> 2280 </ul> 2281 <h3 id="rfc.section.6.4.1"><a href="#rfc.section.6.4.1">6.4.1</a> <a id="content.coding.registry" href="#content.coding.registry">Content Coding Registry</a></h3> 2282 <p id="rfc.section.6.4.1.p.1">The HTTP Content Coding Registry defines the name space for the content coding names.</p> 2283 <p id="rfc.section.6.4.1.p.2">Registrations <em class="bcp14">MUST</em> include the following fields: 2208 2284 </p> 2209 2285 <ul> … … 2212 2288 <li>Pointer to specification text</li> 2213 2289 </ul> 2214 <p id="rfc.section. 5.4.1.p.3">Names of content codings <em class="bcp14">MUST NOT</em> overlap with names of transfer codings (<a href="p1-messaging.html#transfer.codings" title="Transfer Codings">Section 4</a> of <a href="#Part1" id="rfc.xref.Part1.28"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>), unless the encoding transformation is identical (as is the case for the compression codings defined in <a href="p1-messaging.html#compression.codings" title="Compression Codings">Section 4.2</a> of <a href="#Part1" id="rfc.xref.Part1.29"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>).2215 </p> 2216 <p id="rfc.section. 5.4.1.p.4">Values to be added to this name space require IETF Review (see <a href="http://tools.ietf.org/html/rfc5226#section-4.1">Section 4.1</a> of <a href="#RFC5226" id="rfc.xref.RFC5226.3"><cite title="Guidelines for Writing an IANA Considerations Section in RFCs">[RFC5226]</cite></a>), and <em class="bcp14">MUST</em> conform to the purpose of content coding defined in this section.2217 </p> 2218 <p id="rfc.section. 5.4.1.p.5">The registry itself is maintained at <<a href="http://www.iana.org/assignments/http-parameters">http://www.iana.org/assignments/http-parameters</a>>.2219 </p> 2220 <h2 id="rfc.section. 5.5"><a href="#rfc.section.5.5">5.5</a> <a id="media.types" href="#media.types">Media Types</a></h2>2221 <p id="rfc.section. 5.5.p.1">HTTP uses Internet Media Types <a href="#RFC2046" id="rfc.xref.RFC2046.1"><cite title="Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types">[RFC2046]</cite></a> in the <a href="#header.content-type" class="smpl">Content-Type</a> (<a href="#header.content-type" id="rfc.xref.header.content-type.3" title="Content-Type">Section 9.9</a>) and <a href="#header.accept" class="smpl">Accept</a> (<a href="#header.accept" id="rfc.xref.header.accept.2" title="Accept">Section 9.1</a>) header fields in order to provide open and extensible data typing and type negotiation.2290 <p id="rfc.section.6.4.1.p.3">Names of content codings <em class="bcp14">MUST NOT</em> overlap with names of transfer codings (<a href="p1-messaging.html#transfer.codings" title="Transfer Codings">Section 4</a> of <a href="#Part1" id="rfc.xref.Part1.30"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>), unless the encoding transformation is identical (as is the case for the compression codings defined in <a href="p1-messaging.html#compression.codings" title="Compression Codings">Section 4.2</a> of <a href="#Part1" id="rfc.xref.Part1.31"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>). 2291 </p> 2292 <p id="rfc.section.6.4.1.p.4">Values to be added to this name space require IETF Review (see <a href="http://tools.ietf.org/html/rfc5226#section-4.1">Section 4.1</a> of <a href="#RFC5226" id="rfc.xref.RFC5226.3"><cite title="Guidelines for Writing an IANA Considerations Section in RFCs">[RFC5226]</cite></a>), and <em class="bcp14">MUST</em> conform to the purpose of content coding defined in this section. 2293 </p> 2294 <p id="rfc.section.6.4.1.p.5">The registry itself is maintained at <<a href="http://www.iana.org/assignments/http-parameters">http://www.iana.org/assignments/http-parameters</a>>. 2295 </p> 2296 <h2 id="rfc.section.6.5"><a href="#rfc.section.6.5">6.5</a> <a id="media.types" href="#media.types">Media Types</a></h2> 2297 <p id="rfc.section.6.5.p.1">HTTP uses Internet Media Types <a href="#RFC2046" id="rfc.xref.RFC2046.1"><cite title="Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types">[RFC2046]</cite></a> in the <a href="#header.content-type" class="smpl">Content-Type</a> (<a href="#header.content-type" id="rfc.xref.header.content-type.3" title="Content-Type">Section 10.9</a>) and <a href="#header.accept" class="smpl">Accept</a> (<a href="#header.accept" id="rfc.xref.header.accept.2" title="Accept">Section 10.1</a>) header fields in order to provide open and extensible data typing and type negotiation. 2222 2298 </p> 2223 2299 <div id="rfc.figure.u.17"></div><pre class="inline"><span id="rfc.iref.g.24"></span><span id="rfc.iref.g.25"></span><span id="rfc.iref.g.26"></span> <a href="#media.types" class="smpl">media-type</a> = <a href="#media.types" class="smpl">type</a> "/" <a href="#media.types" class="smpl">subtype</a> *( <a href="#imported.abnf" class="smpl">OWS</a> ";" <a href="#imported.abnf" class="smpl">OWS</a> <a href="#rule.parameter" class="smpl">parameter</a> ) … … 2225 2301 <a href="#media.types" class="smpl">subtype</a> = <a href="#imported.abnf" class="smpl">token</a> 2226 2302 </pre><div id="rule.parameter"> 2227 <p id="rfc.section. 5.5.p.3"> The type/subtype <em class="bcp14">MAY</em> be followed by parameters in the form of attribute/value pairs.2303 <p id="rfc.section.6.5.p.3"> The type/subtype <em class="bcp14">MAY</em> be followed by parameters in the form of attribute/value pairs. 2228 2304 </p> 2229 2305 </div> … … 2231 2307 <a href="#rule.parameter" class="smpl">attribute</a> = <a href="#imported.abnf" class="smpl">token</a> 2232 2308 <a href="#rule.parameter" class="smpl">value</a> = <a href="#imported.abnf" class="smpl">word</a> 2233 </pre><p id="rfc.section. 5.5.p.5">The type, subtype, and parameter attribute names are case-insensitive. Parameter values might or might not be case-sensitive,2309 </pre><p id="rfc.section.6.5.p.5">The type, subtype, and parameter attribute names are case-insensitive. Parameter values might or might not be case-sensitive, 2234 2310 depending on the semantics of the parameter name. The presence or absence of a parameter might be significant to the processing 2235 2311 of a media-type, depending on its definition within the media type registry. 2236 2312 </p> 2237 <p id="rfc.section. 5.5.p.6">A parameter value that matches the <a href="#imported.abnf" class="smpl">token</a> production can be transmitted as either a token or within a quoted-string. The quoted and unquoted values are equivalent.2238 </p> 2239 <p id="rfc.section. 5.5.p.7">Note that some older HTTP applications do not recognize media type parameters. When sending data to older HTTP applications,2313 <p id="rfc.section.6.5.p.6">A parameter value that matches the <a href="#imported.abnf" class="smpl">token</a> production can be transmitted as either a token or within a quoted-string. The quoted and unquoted values are equivalent. 2314 </p> 2315 <p id="rfc.section.6.5.p.7">Note that some older HTTP applications do not recognize media type parameters. When sending data to older HTTP applications, 2240 2316 implementations <em class="bcp14">SHOULD</em> only use media type parameters when they are required by that type/subtype definition. 2241 2317 </p> 2242 <p id="rfc.section. 5.5.p.8">Media-type values are registered with the Internet Assigned Number Authority (IANA). The media type registration process is2318 <p id="rfc.section.6.5.p.8">Media-type values are registered with the Internet Assigned Number Authority (IANA). The media type registration process is 2243 2319 outlined in <a href="#RFC4288" id="rfc.xref.RFC4288.1"><cite title="Media Type Specifications and Registration Procedures">[RFC4288]</cite></a>. Use of non-registered media types is discouraged. 2244 2320 </p> 2245 <h3 id="rfc.section. 5.5.1"><a href="#rfc.section.5.5.1">5.5.1</a> <a id="canonicalization.and.text.defaults" href="#canonicalization.and.text.defaults">Canonicalization and Text Defaults</a></h3>2246 <p id="rfc.section. 5.5.1.p.1">Internet media types are registered with a canonical form. A representation transferred via HTTP messages <em class="bcp14">MUST</em> be in the appropriate canonical form prior to its transmission except for "text" types, as defined in the next paragraph.2247 </p> 2248 <p id="rfc.section. 5.5.1.p.2">When in canonical form, media subtypes of the "text" type use CRLF as the text line break. HTTP relaxes this requirement and2321 <h3 id="rfc.section.6.5.1"><a href="#rfc.section.6.5.1">6.5.1</a> <a id="canonicalization.and.text.defaults" href="#canonicalization.and.text.defaults">Canonicalization and Text Defaults</a></h3> 2322 <p id="rfc.section.6.5.1.p.1">Internet media types are registered with a canonical form. A representation transferred via HTTP messages <em class="bcp14">MUST</em> be in the appropriate canonical form prior to its transmission except for "text" types, as defined in the next paragraph. 2323 </p> 2324 <p id="rfc.section.6.5.1.p.2">When in canonical form, media subtypes of the "text" type use CRLF as the text line break. HTTP relaxes this requirement and 2249 2325 allows the transport of text media with plain CR or LF alone representing a line break when it is done consistently for an 2250 2326 entire representation. HTTP applications <em class="bcp14">MUST</em> accept CRLF, bare CR, and bare LF as indicating a line break in text media received via HTTP. In addition, if the text is … … 2254 2330 body; a bare CR or LF <em class="bcp14">MUST NOT</em> be substituted for CRLF within any of the HTTP control structures (such as header fields and multipart boundaries). 2255 2331 </p> 2256 <p id="rfc.section. 5.5.1.p.3">If a representation is encoded with a content-coding, the underlying data <em class="bcp14">MUST</em> be in a form defined above prior to being encoded.2257 </p> 2258 <h3 id="rfc.section. 5.5.2"><a href="#rfc.section.5.5.2">5.5.2</a> <a id="multipart.types" href="#multipart.types">Multipart Types</a></h3>2259 <p id="rfc.section. 5.5.2.p.1">MIME provides for a number of "multipart" types — encapsulations of one or more representations within a single message body.2332 <p id="rfc.section.6.5.1.p.3">If a representation is encoded with a content-coding, the underlying data <em class="bcp14">MUST</em> be in a form defined above prior to being encoded. 2333 </p> 2334 <h3 id="rfc.section.6.5.2"><a href="#rfc.section.6.5.2">6.5.2</a> <a id="multipart.types" href="#multipart.types">Multipart Types</a></h3> 2335 <p id="rfc.section.6.5.2.p.1">MIME provides for a number of "multipart" types — encapsulations of one or more representations within a single message body. 2260 2336 All multipart types share a common syntax, as defined in <a href="http://tools.ietf.org/html/rfc2046#section-5.1.1">Section 5.1.1</a> of <a href="#RFC2046" id="rfc.xref.RFC2046.2"><cite title="Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types">[RFC2046]</cite></a>, and <em class="bcp14">MUST</em> include a boundary parameter as part of the media type value. The message body is itself a protocol element and <em class="bcp14">MUST</em> therefore use only CRLF to represent line breaks between body-parts. 2261 2337 </p> 2262 <p id="rfc.section. 5.5.2.p.2">In general, HTTP treats a multipart message body no differently than any other media type: strictly as payload. HTTP does2338 <p id="rfc.section.6.5.2.p.2">In general, HTTP treats a multipart message body no differently than any other media type: strictly as payload. HTTP does 2263 2339 not use the multipart boundary as an indicator of message body length. In all other respects, an HTTP user agent <em class="bcp14">SHOULD</em> follow the same or similar behavior as a MIME user agent would upon receipt of a multipart type. The MIME header fields within 2264 2340 each body-part of a multipart message body do not have any significance to HTTP beyond that defined by their MIME semantics. 2265 2341 </p> 2266 <p id="rfc.section. 5.5.2.p.3">If an application receives an unrecognized multipart subtype, the application <em class="bcp14">MUST</em> treat it as being equivalent to "multipart/mixed".2267 </p> 2268 <div class="note" id="rfc.section. 5.5.2.p.4">2342 <p id="rfc.section.6.5.2.p.3">If an application receives an unrecognized multipart subtype, the application <em class="bcp14">MUST</em> treat it as being equivalent to "multipart/mixed". 2343 </p> 2344 <div class="note" id="rfc.section.6.5.2.p.4"> 2269 2345 <p> <b>Note:</b> The "multipart/form-data" type has been specifically defined for carrying form data suitable for processing via the POST request 2270 2346 method, as described in <a href="#RFC2388" id="rfc.xref.RFC2388.1"><cite title="Returning Values from Forms: multipart/form-data">[RFC2388]</cite></a>. 2271 2347 </p> 2272 2348 </div> 2273 <h2 id="rfc.section. 5.6"><a href="#rfc.section.5.6">5.6</a> <a id="language.tags" href="#language.tags">Language Tags</a></h2>2274 <p id="rfc.section. 5.6.p.1">A language tag, as defined in <a href="#RFC5646" id="rfc.xref.RFC5646.1"><cite title="Tags for Identifying Languages">[RFC5646]</cite></a>, identifies a natural language spoken, written, or otherwise conveyed by human beings for communication of information to2349 <h2 id="rfc.section.6.6"><a href="#rfc.section.6.6">6.6</a> <a id="language.tags" href="#language.tags">Language Tags</a></h2> 2350 <p id="rfc.section.6.6.p.1">A language tag, as defined in <a href="#RFC5646" id="rfc.xref.RFC5646.1"><cite title="Tags for Identifying Languages">[RFC5646]</cite></a>, identifies a natural language spoken, written, or otherwise conveyed by human beings for communication of information to 2275 2351 other human beings. Computer languages are explicitly excluded. HTTP uses language tags within the <a href="#header.accept-language" class="smpl">Accept-Language</a> and <a href="#header.content-language" class="smpl">Content-Language</a> fields. 2276 2352 </p> 2277 <p id="rfc.section. 5.6.p.2">In summary, a language tag is composed of one or more parts: A primary language subtag followed by a possibly empty series2353 <p id="rfc.section.6.6.p.2">In summary, a language tag is composed of one or more parts: A primary language subtag followed by a possibly empty series 2278 2354 of subtags: 2279 2355 </p> 2280 2356 <div id="rfc.figure.u.19"></div><pre class="inline"><span id="rfc.iref.g.30"></span> <a href="#language.tags" class="smpl">language-tag</a> = <Language-Tag, defined in <a href="#RFC5646" id="rfc.xref.RFC5646.2"><cite title="Tags for Identifying Languages">[RFC5646]</cite></a>, <a href="http://tools.ietf.org/html/rfc5646#section-2.1">Section 2.1</a>> 2281 </pre><p id="rfc.section. 5.6.p.4">White space is not allowed within the tag and all tags are case-insensitive. The name space of language subtags is administered2357 </pre><p id="rfc.section.6.6.p.4">White space is not allowed within the tag and all tags are case-insensitive. The name space of language subtags is administered 2282 2358 by the IANA (see <<a href="http://www.iana.org/assignments/language-subtag-registry">http://www.iana.org/assignments/language-subtag-registry</a>>). 2283 2359 </p> 2284 2360 <div id="rfc.figure.u.20"></div> 2285 2361 <p>Example tags include:</p> <pre class="text"> en, en-US, es-419, az-Arab, x-pig-latin, man-Nkoo-GN 2286 </pre> <p id="rfc.section. 5.6.p.6">See <a href="#RFC5646" id="rfc.xref.RFC5646.3"><cite title="Tags for Identifying Languages">[RFC5646]</cite></a> for further information.2287 </p> 2288 <h1 id="rfc.section. 6"><a href="#rfc.section.6">6.</a> <a id="payload" href="#payload">Payload</a></h1>2289 <p id="rfc.section. 6.p.1">HTTP messages <em class="bcp14">MAY</em> transfer a payload if not otherwise restricted by the request method or response status code. The payload consists of metadata,2362 </pre> <p id="rfc.section.6.6.p.6">See <a href="#RFC5646" id="rfc.xref.RFC5646.3"><cite title="Tags for Identifying Languages">[RFC5646]</cite></a> for further information. 2363 </p> 2364 <h1 id="rfc.section.7"><a href="#rfc.section.7">7.</a> <a id="payload" href="#payload">Payload</a></h1> 2365 <p id="rfc.section.7.p.1">HTTP messages <em class="bcp14">MAY</em> transfer a payload if not otherwise restricted by the request method or response status code. The payload consists of metadata, 2290 2366 in the form of header fields, and data, in the form of the sequence of octets in the message body after any transfer-coding 2291 2367 has been decoded. 2292 2368 </p> 2293 2369 <div id="rfc.iref.p.3"></div> 2294 <p id="rfc.section. 6.p.2">A "<dfn>payload</dfn>" in HTTP is always a partial or complete representation of some resource. We use separate terms for payload and representation2370 <p id="rfc.section.7.p.2">A "<dfn>payload</dfn>" in HTTP is always a partial or complete representation of some resource. We use separate terms for payload and representation 2295 2371 because some messages contain only the associated representation's header fields (e.g., responses to HEAD) or only some part(s) 2296 2372 of the representation (e.g., the <a href="p5-range.html#status.206" class="smpl">206 (Partial Content)</a> status code). 2297 2373 </p> 2298 <h2 id="rfc.section. 6.1"><a href="#rfc.section.6.1">6.1</a> <a id="payload.header.fields" href="#payload.header.fields">Payload Header Fields</a></h2>2299 <p id="rfc.section. 6.1.p.1">HTTP header fields that specifically define the payload, rather than the associated representation, are referred to as "payload2374 <h2 id="rfc.section.7.1"><a href="#rfc.section.7.1">7.1</a> <a id="payload.header.fields" href="#payload.header.fields">Payload Header Fields</a></h2> 2375 <p id="rfc.section.7.1.p.1">HTTP header fields that specifically define the payload, rather than the associated representation, are referred to as "payload 2300 2376 header fields". The following payload header fields are defined by HTTP/1.1: 2301 2377 </p> … … 2311 2387 <tr> 2312 2388 <td class="left">Content-Length</td> 2313 <td class="left"><a href="p1-messaging.html#header.content-length" title="Content-Length">Section 3.3.2</a> of <a href="#Part1" id="rfc.xref.Part1.3 0"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a></td>2389 <td class="left"><a href="p1-messaging.html#header.content-length" title="Content-Length">Section 3.3.2</a> of <a href="#Part1" id="rfc.xref.Part1.32"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a></td> 2314 2390 </tr> 2315 2391 <tr> … … 2320 2396 </table> 2321 2397 </div> 2322 <h2 id="rfc.section. 6.2"><a href="#rfc.section.6.2">6.2</a> <a id="payload.body" href="#payload.body">Payload Body</a></h2>2323 <p id="rfc.section. 6.2.p.1">A payload body is only present in a message when a message body is present, as described in <a href="p1-messaging.html#message.body" title="Message Body">Section 3.3</a> of <a href="#Part1" id="rfc.xref.Part1.31"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>. The payload body is obtained from the message body by decoding any <a href="p1-messaging.html#header.transfer-encoding" class="smpl">Transfer-Encoding</a> that might have been applied to ensure safe and proper transfer of the message.2398 <h2 id="rfc.section.7.2"><a href="#rfc.section.7.2">7.2</a> <a id="payload.body" href="#payload.body">Payload Body</a></h2> 2399 <p id="rfc.section.7.2.p.1">A payload body is only present in a message when a message body is present, as described in <a href="p1-messaging.html#message.body" title="Message Body">Section 3.3</a> of <a href="#Part1" id="rfc.xref.Part1.33"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>. The payload body is obtained from the message body by decoding any <a href="p1-messaging.html#header.transfer-encoding" class="smpl">Transfer-Encoding</a> that might have been applied to ensure safe and proper transfer of the message. 2324 2400 </p> 2325 2401 <div id="rfc.iref.r.1"></div> 2326 <h1 id="rfc.section. 7"><a href="#rfc.section.7">7.</a> <a id="representation" href="#representation">Representation</a></h1>2327 <p id="rfc.section. 7.p.1">A "<dfn>representation</dfn>" is information in a format that can be readily communicated from one party to another. A resource representation is information2402 <h1 id="rfc.section.8"><a href="#rfc.section.8">8.</a> <a id="representation" href="#representation">Representation</a></h1> 2403 <p id="rfc.section.8.p.1">A "<dfn>representation</dfn>" is information in a format that can be readily communicated from one party to another. A resource representation is information 2328 2404 that reflects the state of that resource, as observed at some point in the past (e.g., in a response to GET) or to be desired 2329 2405 at some point in the future (e.g., in a PUT request). 2330 2406 </p> 2331 <p id="rfc.section. 7.p.2">Most, but not all, representations transferred via HTTP are intended to be a representation of the target resource (the resource2407 <p id="rfc.section.8.p.2">Most, but not all, representations transferred via HTTP are intended to be a representation of the target resource (the resource 2332 2408 identified by the effective request URI). The precise semantics of a representation are determined by the type of message 2333 2409 (request or response), the request method, the response status code, and the representation metadata. For example, the above … … 2336 2412 contain a representation that describes the error and what next steps are suggested for resolving it. 2337 2413 </p> 2338 <p id="rfc.section. 7.p.3">Request and Response messages <em class="bcp14">MAY</em> transfer a representation if not otherwise restricted by the request method or response status code. A representation consists2414 <p id="rfc.section.8.p.3">Request and Response messages <em class="bcp14">MAY</em> transfer a representation if not otherwise restricted by the request method or response status code. A representation consists 2339 2415 of metadata (representation header fields) and data (representation body). When a complete or partial representation is enclosed 2340 2416 in an HTTP message, it is referred to as the payload of the message. 2341 2417 </p> 2342 <p id="rfc.section. 7.p.4">A representation body is only present in a message when a message body is present, as described in <a href="p1-messaging.html#message.body" title="Message Body">Section 3.3</a> of <a href="#Part1" id="rfc.xref.Part1.32"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>. The representation body is obtained from the message body by decoding any <a href="p1-messaging.html#header.transfer-encoding" class="smpl">Transfer-Encoding</a> that might have been applied to ensure safe and proper transfer of the message.2343 </p> 2344 <h2 id="rfc.section. 7.1"><a href="#rfc.section.7.1">7.1</a> <a id="identifying.response.associated.with.representation" href="#identifying.response.associated.with.representation">Identifying the Resource Associated with a Representation</a></h2>2345 <p id="rfc.section. 7.1.p.1">It is sometimes necessary to determine an identifier for the resource associated with a representation.</p>2346 <p id="rfc.section. 7.1.p.2">An HTTP request representation, when present, is always associated with an anonymous (i.e., unidentified) resource.</p>2347 <p id="rfc.section. 7.1.p.3">In the common case, an HTTP response is a representation of the target resource (see <a href="p1-messaging.html#effective.request.uri" title="Effective Request URI">Section 5.5</a> of <a href="#Part1" id="rfc.xref.Part1.33"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>). However, this is not always the case. To determine the URI of the resource a response is associated with, the following2418 <p id="rfc.section.8.p.4">A representation body is only present in a message when a message body is present, as described in <a href="p1-messaging.html#message.body" title="Message Body">Section 3.3</a> of <a href="#Part1" id="rfc.xref.Part1.34"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>. The representation body is obtained from the message body by decoding any <a href="p1-messaging.html#header.transfer-encoding" class="smpl">Transfer-Encoding</a> that might have been applied to ensure safe and proper transfer of the message. 2419 </p> 2420 <h2 id="rfc.section.8.1"><a href="#rfc.section.8.1">8.1</a> <a id="identifying.response.associated.with.representation" href="#identifying.response.associated.with.representation">Identifying the Resource Associated with a Representation</a></h2> 2421 <p id="rfc.section.8.1.p.1">It is sometimes necessary to determine an identifier for the resource associated with a representation.</p> 2422 <p id="rfc.section.8.1.p.2">An HTTP request representation, when present, is always associated with an anonymous (i.e., unidentified) resource.</p> 2423 <p id="rfc.section.8.1.p.3">In the common case, an HTTP response is a representation of the target resource (see <a href="p1-messaging.html#effective.request.uri" title="Effective Request URI">Section 5.5</a> of <a href="#Part1" id="rfc.xref.Part1.35"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>). However, this is not always the case. To determine the URI of the resource a response is associated with, the following 2348 2424 rules are used (with the first applicable one being selected): 2349 2425 </p> … … 2363 2439 <li>Otherwise, the response is a representation of an anonymous (i.e., unidentified) resource.</li> 2364 2440 </ol> 2365 <p id="rfc.section. 7.1.p.5"> <span class="comment" id="TODO-req-uri">[<a href="#TODO-req-uri" class="smpl">TODO-req-uri</a>: The comparison function is going to have to be defined somewhere, because we already need to compare URIs for things like2441 <p id="rfc.section.8.1.p.5"> <span class="comment" id="TODO-req-uri">[<a href="#TODO-req-uri" class="smpl">TODO-req-uri</a>: The comparison function is going to have to be defined somewhere, because we already need to compare URIs for things like 2366 2442 cache invalidation.]</span> 2367 2443 </p> 2368 <h2 id="rfc.section. 7.2"><a href="#rfc.section.7.2">7.2</a> <a id="representation.header.fields" href="#representation.header.fields">Representation Header Fields</a></h2>2369 <p id="rfc.section. 7.2.p.1">Representation header fields define metadata about the representation data enclosed in the message body or, if no message2444 <h2 id="rfc.section.8.2"><a href="#rfc.section.8.2">8.2</a> <a id="representation.header.fields" href="#representation.header.fields">Representation Header Fields</a></h2> 2445 <p id="rfc.section.8.2.p.1">Representation header fields define metadata about the representation data enclosed in the message body or, if no message 2370 2446 body is present, about the representation that would have been transferred in a <a href="#status.200" class="smpl">200 (OK)</a> response to a simultaneous GET request with the same effective request URI. 2371 2447 </p> 2372 <p id="rfc.section. 7.2.p.2">The following header fields are defined as representation metadata:</p>2448 <p id="rfc.section.8.2.p.2">The following header fields are defined as representation metadata:</p> 2373 2449 <div id="rfc.table.u.5"> 2374 2450 <table class="tt full left" cellpadding="3" cellspacing="0"> … … 2382 2458 <tr> 2383 2459 <td class="left">Content-Encoding</td> 2384 <td class="left"><a href="#header.content-encoding" id="rfc.xref.header.content-encoding.2" title="Content-Encoding">Section 9.6</a></td>2460 <td class="left"><a href="#header.content-encoding" id="rfc.xref.header.content-encoding.2" title="Content-Encoding">Section 10.6</a></td> 2385 2461 </tr> 2386 2462 <tr> 2387 2463 <td class="left">Content-Language</td> 2388 <td class="left"><a href="#header.content-language" id="rfc.xref.header.content-language.1" title="Content-Language">Section 9.7</a></td>2464 <td class="left"><a href="#header.content-language" id="rfc.xref.header.content-language.1" title="Content-Language">Section 10.7</a></td> 2389 2465 </tr> 2390 2466 <tr> 2391 2467 <td class="left">Content-Location</td> 2392 <td class="left"><a href="#header.content-location" id="rfc.xref.header.content-location.2" title="Content-Location">Section 9.8</a></td>2468 <td class="left"><a href="#header.content-location" id="rfc.xref.header.content-location.2" title="Content-Location">Section 10.8</a></td> 2393 2469 </tr> 2394 2470 <tr> 2395 2471 <td class="left">Content-Type</td> 2396 <td class="left"><a href="#header.content-type" id="rfc.xref.header.content-type.4" title="Content-Type">Section 9.9</a></td>2472 <td class="left"><a href="#header.content-type" id="rfc.xref.header.content-type.4" title="Content-Type">Section 10.9</a></td> 2397 2473 </tr> 2398 2474 <tr> … … 2403 2479 </table> 2404 2480 </div> 2405 <p id="rfc.section. 7.2.p.3"><span id="rfc.iref.s.43"></span> We use the term "<dfn>selected representation</dfn>" to refer to the the current representation of a target resource that would have been selected in a successful response if2481 <p id="rfc.section.8.2.p.3"><span id="rfc.iref.s.43"></span> We use the term "<dfn>selected representation</dfn>" to refer to the the current representation of a target resource that would have been selected in a successful response if 2406 2482 the same request had used the method GET and excluded any conditional request header fields. 2407 2483 </p> 2408 <p id="rfc.section. 7.2.p.4">Additional header fields define metadata about the selected representation, which might differ from the representation included2484 <p id="rfc.section.8.2.p.4">Additional header fields define metadata about the selected representation, which might differ from the representation included 2409 2485 in the message for responses to some state-changing methods. The following header fields are defined as selected representation 2410 2486 metadata: … … 2430 2506 </table> 2431 2507 </div> 2432 <h2 id="rfc.section. 7.3"><a href="#rfc.section.7.3">7.3</a> <a id="representation.data" href="#representation.data">Representation Data</a></h2>2433 <p id="rfc.section. 7.3.p.1">The representation body associated with an HTTP message is either provided as the payload body of the message or referred2508 <h2 id="rfc.section.8.3"><a href="#rfc.section.8.3">8.3</a> <a id="representation.data" href="#representation.data">Representation Data</a></h2> 2509 <p id="rfc.section.8.3.p.1">The representation body associated with an HTTP message is either provided as the payload body of the message or referred 2434 2510 to by the message semantics and the effective request URI. The representation data is in a format and encoding defined by 2435 2511 the representation metadata header fields. 2436 2512 </p> 2437 <p id="rfc.section. 7.3.p.2">The data type of the representation data is determined via the header fields <a href="#header.content-type" class="smpl">Content-Type</a> and <a href="#header.content-encoding" class="smpl">Content-Encoding</a>. These define a two-layer, ordered encoding model:2513 <p id="rfc.section.8.3.p.2">The data type of the representation data is determined via the header fields <a href="#header.content-type" class="smpl">Content-Type</a> and <a href="#header.content-encoding" class="smpl">Content-Encoding</a>. These define a two-layer, ordered encoding model: 2438 2514 </p> 2439 2515 <div id="rfc.figure.u.21"></div><pre class="text"> representation-data := Content-Encoding( Content-Type( bits ) ) 2440 </pre><p id="rfc.section. 7.3.p.4"> <a href="#header.content-type" class="smpl">Content-Type</a> specifies the media type of the underlying data, which defines both the data format and how that data <em class="bcp14">SHOULD</em> be processed by the recipient (within the scope of the request method semantics). Any HTTP/1.1 message containing a payload2516 </pre><p id="rfc.section.8.3.p.4"> <a href="#header.content-type" class="smpl">Content-Type</a> specifies the media type of the underlying data, which defines both the data format and how that data <em class="bcp14">SHOULD</em> be processed by the recipient (within the scope of the request method semantics). Any HTTP/1.1 message containing a payload 2441 2517 body <em class="bcp14">SHOULD</em> include a Content-Type header field defining the media type of the associated representation unless that metadata is unknown 2442 2518 to the sender. If the Content-Type header field is not present, it indicates that the sender does not know the media type 2443 2519 of the representation; recipients <em class="bcp14">MAY</em> either assume that the media type is "application/octet-stream" (<a href="#RFC2046" id="rfc.xref.RFC2046.3"><cite title="Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types">[RFC2046]</cite></a>, <a href="http://tools.ietf.org/html/rfc2046#section-4.5.1">Section 4.5.1</a>) or examine the content to determine its type. 2444 2520 </p> 2445 <p id="rfc.section. 7.3.p.5">In practice, resource owners do not always properly configure their origin server to provide the correct Content-Type for2521 <p id="rfc.section.8.3.p.5">In practice, resource owners do not always properly configure their origin server to provide the correct Content-Type for 2446 2522 a given representation, with the result that some clients will examine a response body's content and override the specified 2447 2523 type. Clients that do so risk drawing incorrect conclusions, which might expose additional security risks (e.g., "privilege … … 2450 2526 such "content sniffing" when it is used. 2451 2527 </p> 2452 <p id="rfc.section. 7.3.p.6"> <a href="#header.content-encoding" class="smpl">Content-Encoding</a> is used to indicate any additional content codings applied to the data, usually for the purpose of data compression, that2528 <p id="rfc.section.8.3.p.6"> <a href="#header.content-encoding" class="smpl">Content-Encoding</a> is used to indicate any additional content codings applied to the data, usually for the purpose of data compression, that 2453 2529 are a property of the representation. If Content-Encoding is not present, then there is no additional encoding beyond that 2454 2530 defined by the <a href="#header.content-type" class="smpl">Content-Type</a> header field. 2455 2531 </p> 2456 <h1 id="rfc.section. 8"><a href="#rfc.section.8">8.</a> <a id="content.negotiation" href="#content.negotiation">Content Negotiation</a></h1>2457 <p id="rfc.section. 8.p.1">HTTP responses include a representation which contains information for interpretation, whether by a human user or for further2532 <h1 id="rfc.section.9"><a href="#rfc.section.9">9.</a> <a id="content.negotiation" href="#content.negotiation">Content Negotiation</a></h1> 2533 <p id="rfc.section.9.p.1">HTTP responses include a representation which contains information for interpretation, whether by a human user or for further 2458 2534 processing. Often, the server has different ways of representing the same information; for example, in different formats, 2459 2535 languages, or using different character encodings. 2460 2536 </p> 2461 <p id="rfc.section. 8.p.2">HTTP clients and their users might have different or variable capabilities, characteristics or preferences which would influence2537 <p id="rfc.section.9.p.2">HTTP clients and their users might have different or variable capabilities, characteristics or preferences which would influence 2462 2538 which representation, among those available from the server, would be best for the server to deliver. For this reason, HTTP 2463 2539 provides mechanisms for "content negotiation" — a process of allowing selection of a representation of a given resource, when 2464 2540 more than one is available. 2465 2541 </p> 2466 <p id="rfc.section. 8.p.3">This specification defines two patterns of content negotiation; "server-driven", where the server selects the representation2542 <p id="rfc.section.9.p.3">This specification defines two patterns of content negotiation; "server-driven", where the server selects the representation 2467 2543 based upon the client's stated preferences, and "agent-driven" negotiation, where the server provides a list of representations 2468 2544 for the client to choose from, based upon their metadata. In addition, there are other patterns: some applications use an … … 2470 2546 parameters, selects additional resources to invoke. "Transparent Content Negotiation" (<a href="#RFC2295" id="rfc.xref.RFC2295.1"><cite title="Transparent Content Negotiation in HTTP">[RFC2295]</cite></a>) has also been proposed. 2471 2547 </p> 2472 <p id="rfc.section. 8.p.4">These patterns are all widely used, and have trade-offs in applicability and practicality. In particular, when the number2548 <p id="rfc.section.9.p.4">These patterns are all widely used, and have trade-offs in applicability and practicality. In particular, when the number 2473 2549 of preferences or capabilities to be expressed by a client are large (such as when many different formats are supported by 2474 2550 a user-agent), server-driven negotiation becomes unwieldy, and might not be appropriate. Conversely, when the number of representations 2475 2551 to choose from is very large, agent-driven negotiation might not be appropriate. 2476 2552 </p> 2477 <p id="rfc.section. 8.p.5">Note that, in all cases, the supplier of representations has the responsibility for determining which representations might2553 <p id="rfc.section.9.p.5">Note that, in all cases, the supplier of representations has the responsibility for determining which representations might 2478 2554 be considered to be the "same information". 2479 2555 </p> 2480 <h2 id="rfc.section. 8.1"><a href="#rfc.section.8.1">8.1</a> <a id="server-driven.negotiation" href="#server-driven.negotiation">Server-driven Negotiation</a></h2>2481 <p id="rfc.section. 8.1.p.1">If the selection of the best representation for a response is made by an algorithm located at the server, it is called server-driven2556 <h2 id="rfc.section.9.1"><a href="#rfc.section.9.1">9.1</a> <a id="server-driven.negotiation" href="#server-driven.negotiation">Server-driven Negotiation</a></h2> 2557 <p id="rfc.section.9.1.p.1">If the selection of the best representation for a response is made by an algorithm located at the server, it is called server-driven 2482 2558 negotiation. Selection is based on the available representations of the response (the dimensions over which it can vary; e.g., 2483 2559 language, content-coding, etc.) and the contents of particular header fields in the request message or on other information 2484 2560 pertaining to the request (such as the network address of the client). 2485 2561 </p> 2486 <p id="rfc.section. 8.1.p.2">Server-driven negotiation is advantageous when the algorithm for selecting from among the available representations is difficult2562 <p id="rfc.section.9.1.p.2">Server-driven negotiation is advantageous when the algorithm for selecting from among the available representations is difficult 2487 2563 to describe to the user agent, or when the server desires to send its "best guess" to the client along with the first response 2488 2564 (hoping to avoid the round-trip delay of a subsequent request if the "best guess" is good enough for the user). In order to 2489 2565 improve the server's guess, the user agent <em class="bcp14">MAY</em> include request header fields (<a href="#header.accept" class="smpl">Accept</a>, <a href="#header.accept-language" class="smpl">Accept-Language</a>, <a href="#header.accept-encoding" class="smpl">Accept-Encoding</a>, etc.) which describe its preferences for such a response. 2490 2566 </p> 2491 <p id="rfc.section. 8.1.p.3">Server-driven negotiation has disadvantages: </p>2567 <p id="rfc.section.9.1.p.3">Server-driven negotiation has disadvantages: </p> 2492 2568 <ol> 2493 2569 <li>It is impossible for the server to accurately determine what might be "best" for any given user, since that would require … … 2501 2577 <li>It might limit a public cache's ability to use the same response for multiple user's requests.</li> 2502 2578 </ol> 2503 <p id="rfc.section. 8.1.p.4">Server-driven negotiation allows the user agent to specify its preferences, but it cannot expect responses to always honor2579 <p id="rfc.section.9.1.p.4">Server-driven negotiation allows the user agent to specify its preferences, but it cannot expect responses to always honor 2504 2580 them. For example, the origin server might not implement server-driven negotiation, or it might decide that sending a response 2505 2581 that doesn't conform to them is better than sending a <a href="#status.406" class="smpl">406 2506 2582 (Not Acceptable)</a> response. 2507 2583 </p> 2508 <p id="rfc.section. 8.1.p.5">HTTP/1.1 includes the following header fields for enabling server-driven negotiation through description of user agent capabilities2509 and user preferences: <a href="#header.accept" class="smpl">Accept</a> (<a href="#header.accept" id="rfc.xref.header.accept.3" title="Accept">Section 9.1</a>), <a href="#header.accept-charset" class="smpl">Accept-Charset</a> (<a href="#header.accept-charset" id="rfc.xref.header.accept-charset.2" title="Accept-Charset">Section 9.2</a>), <a href="#header.accept-encoding" class="smpl">Accept-Encoding</a> (<a href="#header.accept-encoding" id="rfc.xref.header.accept-encoding.3" title="Accept-Encoding">Section 9.3</a>), <a href="#header.accept-language" class="smpl">Accept-Language</a> (<a href="#header.accept-language" id="rfc.xref.header.accept-language.2" title="Accept-Language">Section 9.4</a>), and <a href="#header.user-agent" class="smpl">User-Agent</a> (<a href="#header.user-agent" id="rfc.xref.header.user-agent.2" title="User-Agent">Section 9.18</a>). However, an origin server is not limited to these dimensions and <em class="bcp14">MAY</em> vary the response based on any aspect of the request, including aspects of the connection (e.g., IP address) or information2584 <p id="rfc.section.9.1.p.5">HTTP/1.1 includes the following header fields for enabling server-driven negotiation through description of user agent capabilities 2585 and user preferences: <a href="#header.accept" class="smpl">Accept</a> (<a href="#header.accept" id="rfc.xref.header.accept.3" title="Accept">Section 10.1</a>), <a href="#header.accept-charset" class="smpl">Accept-Charset</a> (<a href="#header.accept-charset" id="rfc.xref.header.accept-charset.2" title="Accept-Charset">Section 10.2</a>), <a href="#header.accept-encoding" class="smpl">Accept-Encoding</a> (<a href="#header.accept-encoding" id="rfc.xref.header.accept-encoding.3" title="Accept-Encoding">Section 10.3</a>), <a href="#header.accept-language" class="smpl">Accept-Language</a> (<a href="#header.accept-language" id="rfc.xref.header.accept-language.2" title="Accept-Language">Section 10.4</a>), and <a href="#header.user-agent" class="smpl">User-Agent</a> (<a href="#header.user-agent" id="rfc.xref.header.user-agent.2" title="User-Agent">Section 10.18</a>). However, an origin server is not limited to these dimensions and <em class="bcp14">MAY</em> vary the response based on any aspect of the request, including aspects of the connection (e.g., IP address) or information 2510 2586 within extension header fields not defined by this specification. 2511 2587 </p> 2512 <div class="note" id="rfc.section. 8.1.p.6">2588 <div class="note" id="rfc.section.9.1.p.6"> 2513 2589 <p> <b>Note:</b> In practice, <a href="#header.user-agent" class="smpl">User-Agent</a> based negotiation is fragile, because new clients might not be recognized. 2514 2590 </p> 2515 2591 </div> 2516 <p id="rfc.section. 8.1.p.7">The <a href="p6-cache.html#header.vary" class="smpl">Vary</a> header field (<a href="p6-cache.html#header.vary" title="Vary">Section 7.5</a> of <a href="#Part6" id="rfc.xref.Part6.19"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>) can be used to express the parameters the server uses to select a representation that is subject to server-driven negotiation.2517 </p> 2518 <h2 id="rfc.section. 8.2"><a href="#rfc.section.8.2">8.2</a> <a id="agent-driven.negotiation" href="#agent-driven.negotiation">Agent-driven Negotiation</a></h2>2519 <p id="rfc.section. 8.2.p.1">With agent-driven negotiation, selection of the best representation for a response is performed by the user agent after receiving2592 <p id="rfc.section.9.1.p.7">The <a href="p6-cache.html#header.vary" class="smpl">Vary</a> header field (<a href="p6-cache.html#header.vary" title="Vary">Section 7.5</a> of <a href="#Part6" id="rfc.xref.Part6.19"><cite title="HTTP/1.1, part 6: Caching">[Part6]</cite></a>) can be used to express the parameters the server uses to select a representation that is subject to server-driven negotiation. 2593 </p> 2594 <h2 id="rfc.section.9.2"><a href="#rfc.section.9.2">9.2</a> <a id="agent-driven.negotiation" href="#agent-driven.negotiation">Agent-driven Negotiation</a></h2> 2595 <p id="rfc.section.9.2.p.1">With agent-driven negotiation, selection of the best representation for a response is performed by the user agent after receiving 2520 2596 an initial response from the origin server. Selection is based on a list of the available representations of the response 2521 2597 included within the header fields or body of the initial response, with each representation identified by its own URI. Selection … … 2523 2599 user selecting from a generated (possibly hypertext) menu. 2524 2600 </p> 2525 <p id="rfc.section. 8.2.p.2">Agent-driven negotiation is advantageous when the response would vary over commonly-used dimensions (such as type, language,2601 <p id="rfc.section.9.2.p.2">Agent-driven negotiation is advantageous when the response would vary over commonly-used dimensions (such as type, language, 2526 2602 or encoding), when the origin server is unable to determine a user agent's capabilities from examining the request, and generally 2527 2603 when public caches are used to distribute server load and reduce network usage. 2528 2604 </p> 2529 <p id="rfc.section. 8.2.p.3">Agent-driven negotiation suffers from the disadvantage of needing a second request to obtain the best alternate representation.2605 <p id="rfc.section.9.2.p.3">Agent-driven negotiation suffers from the disadvantage of needing a second request to obtain the best alternate representation. 2530 2606 This second request is only efficient when caching is used. In addition, this specification does not define any mechanism 2531 2607 for supporting automatic selection, though it also does not prevent any such mechanism from being developed as an extension 2532 2608 and used within HTTP/1.1. 2533 2609 </p> 2534 <p id="rfc.section. 8.2.p.4">This specification defines the <a href="#status.300" class="smpl">300 (Multiple Choices)</a> and <a href="#status.406" class="smpl">406 (Not Acceptable)</a> status codes for enabling agent-driven negotiation when the server is unwilling or unable to provide a varying response using2610 <p id="rfc.section.9.2.p.4">This specification defines the <a href="#status.300" class="smpl">300 (Multiple Choices)</a> and <a href="#status.406" class="smpl">406 (Not Acceptable)</a> status codes for enabling agent-driven negotiation when the server is unwilling or unable to provide a varying response using 2535 2611 server-driven negotiation. 2536 2612 </p> 2537 <h2 id="rfc.section. 8.3"><a href="#rfc.section.8.3">8.3</a> <a id="quality.values" href="#quality.values">Quality Values</a></h2>2538 <p id="rfc.section. 8.3.p.1">Many of the request header fields for server-driven content negotiation use a common parameter, named "q", to assign a relative2613 <h2 id="rfc.section.9.3"><a href="#rfc.section.9.3">9.3</a> <a id="quality.values" href="#quality.values">Quality Values</a></h2> 2614 <p id="rfc.section.9.3.p.1">Many of the request header fields for server-driven content negotiation use a common parameter, named "q", to assign a relative 2539 2615 "weight" to the preference for that associated kind of content. This weight is referred to as a "quality value" (or "qvalue") 2540 2616 because the same parameter name is often used within server configurations to assign a weight to the relative quality of the 2541 2617 various representations that can be selected for a resource. 2542 2618 </p> 2543 <p id="rfc.section. 8.3.p.2">The weight is normalized to a real number in the range 0 through 1, where 0.001 is the least preferred and 1 is the most preferred;2619 <p id="rfc.section.9.3.p.2">The weight is normalized to a real number in the range 0 through 1, where 0.001 is the least preferred and 1 is the most preferred; 2544 2620 a value of 0 means "not acceptable". If no "q" parameter is present, the default weight is 1. 2545 2621 </p> … … 2547 2623 <a href="#quality.values" class="smpl">qvalue</a> = ( "0" [ "." 0*3<a href="#imported.abnf" class="smpl">DIGIT</a> ] ) 2548 2624 / ( "1" [ "." 0*3("0") ] ) 2549 </pre><p id="rfc.section. 8.3.p.4">A sender of qvalue <em class="bcp14">MUST NOT</em> generate more than three digits after the decimal point. User configuration of these values ought to be limited in the same2625 </pre><p id="rfc.section.9.3.p.4">A sender of qvalue <em class="bcp14">MUST NOT</em> generate more than three digits after the decimal point. User configuration of these values ought to be limited in the same 2550 2626 fashion. 2551 2627 </p> 2552 <h1 id="rfc.section. 9"><a href="#rfc.section.9">9.</a> <a id="header.field.definitions" href="#header.field.definitions">Header Field Definitions</a></h1>2553 <p id="rfc.section. 9.p.1">This section defines the syntax and semantics of HTTP/1.1 header fields related to request and response semantics and to the2628 <h1 id="rfc.section.10"><a href="#rfc.section.10">10.</a> <a id="header.field.definitions" href="#header.field.definitions">Header Field Definitions</a></h1> 2629 <p id="rfc.section.10.p.1">This section defines the syntax and semantics of HTTP/1.1 header fields related to request and response semantics and to the 2554 2630 payload of messages. 2555 2631 </p> 2556 2632 <div id="rfc.iref.a.1"></div> 2557 2633 <div id="rfc.iref.h.2"></div> 2558 <h2 id="rfc.section. 9.1"><a href="#rfc.section.9.1">9.1</a> <a id="header.accept" href="#header.accept">Accept</a></h2>2559 <p id="rfc.section. 9.1.p.1">The "Accept" header field can be used by user agents to specify response media types that are acceptable. Accept header fields2634 <h2 id="rfc.section.10.1"><a href="#rfc.section.10.1">10.1</a> <a id="header.accept" href="#header.accept">Accept</a></h2> 2635 <p id="rfc.section.10.1.p.1">The "Accept" header field can be used by user agents to specify response media types that are acceptable. Accept header fields 2560 2636 can be used to indicate that the request is specifically limited to a small set of desired types, as in the case of a request 2561 2637 for an in-line image. … … 2569 2645 <a href="#header.accept" class="smpl">accept-params</a> = <a href="#quality.values" class="smpl">weight</a> *( <a href="#header.accept" class="smpl">accept-ext</a> ) 2570 2646 <a href="#header.accept" class="smpl">accept-ext</a> = <a href="#imported.abnf" class="smpl">OWS</a> ";" <a href="#imported.abnf" class="smpl">OWS</a> <a href="#imported.abnf" class="smpl">token</a> [ "=" <a href="#imported.abnf" class="smpl">word</a> ] 2571 </pre><p id="rfc.section. 9.1.p.3">The asterisk "*" character is used to group media types into ranges, with "*/*" indicating all media types and "type/*" indicating2647 </pre><p id="rfc.section.10.1.p.3">The asterisk "*" character is used to group media types into ranges, with "*/*" indicating all media types and "type/*" indicating 2572 2648 all subtypes of that type. The media-range <em class="bcp14">MAY</em> include media type parameters that are applicable to that range. 2573 2649 </p> 2574 <p id="rfc.section. 9.1.p.4">Each media-range <em class="bcp14">MAY</em> be followed by one or more accept-params, beginning with the "q" parameter for indicating a relative weight, as defined in <a href="#quality.values" title="Quality Values">Section 8.3</a>. The first "q" parameter (if any) separates the media-range parameter(s) from the accept-params.2575 </p> 2576 <div class="note" id="rfc.section. 9.1.p.5">2650 <p id="rfc.section.10.1.p.4">Each media-range <em class="bcp14">MAY</em> be followed by one or more accept-params, beginning with the "q" parameter for indicating a relative weight, as defined in <a href="#quality.values" title="Quality Values">Section 9.3</a>. The first "q" parameter (if any) separates the media-range parameter(s) from the accept-params. 2651 </p> 2652 <div class="note" id="rfc.section.10.1.p.5"> 2577 2653 <p> <b>Note:</b> Use of the "q" parameter name to separate media type parameters from Accept extension parameters is due to historical practice. 2578 2654 Although this prevents any media type parameter named "q" from being used with a media range, such an event is believed to … … 2581 2657 </p> 2582 2658 </div> 2583 <p id="rfc.section. 9.1.p.6">The example</p>2659 <p id="rfc.section.10.1.p.6">The example</p> 2584 2660 <div id="rfc.figure.u.24"></div><pre class="text"> Accept: audio/*; q=0.2, audio/basic 2585 </pre><p id="rfc.section. 9.1.p.8"> <em class="bcp14">SHOULD</em> be interpreted as "I prefer audio/basic, but send me any audio type if it is the best available after an 80% mark-down in2661 </pre><p id="rfc.section.10.1.p.8"> <em class="bcp14">SHOULD</em> be interpreted as "I prefer audio/basic, but send me any audio type if it is the best available after an 80% mark-down in 2586 2662 quality". 2587 2663 </p> 2588 <p id="rfc.section. 9.1.p.9">A request without any Accept header field implies that the user agent will accept any media type in response. If an Accept2664 <p id="rfc.section.10.1.p.9">A request without any Accept header field implies that the user agent will accept any media type in response. If an Accept 2589 2665 header field is present in a request and none of the available representations for the response have a media type that is 2590 2666 listed as acceptable, the origin server <em class="bcp14">MAY</em> either honor the Accept header field by sending a <a href="#status.406" class="smpl">406 (Not Acceptable)</a> response or disregard the Accept header field by treating the response as if it is not subject to content negotiation. 2591 2667 </p> 2592 <p id="rfc.section. 9.1.p.10">A more elaborate example is</p>2668 <p id="rfc.section.10.1.p.10">A more elaborate example is</p> 2593 2669 <div id="rfc.figure.u.25"></div><pre class="text"> Accept: text/plain; q=0.5, text/html, 2594 2670 text/x-dvi; q=0.8, text/x-c 2595 </pre><p id="rfc.section. 9.1.p.12">Verbally, this would be interpreted as "text/html and text/x-c are the preferred media types, but if they do not exist, then2671 </pre><p id="rfc.section.10.1.p.12">Verbally, this would be interpreted as "text/html and text/x-c are the preferred media types, but if they do not exist, then 2596 2672 send the text/x-dvi representation, and if that does not exist, send the text/plain representation". 2597 2673 </p> 2598 <p id="rfc.section. 9.1.p.13">Media ranges can be overridden by more specific media ranges or specific media types. If more than one media range applies2674 <p id="rfc.section.10.1.p.13">Media ranges can be overridden by more specific media ranges or specific media types. If more than one media range applies 2599 2675 to a given type, the most specific reference has precedence. For example, 2600 2676 </p> 2601 2677 <div id="rfc.figure.u.26"></div><pre class="text"> Accept: text/*, text/plain, text/plain;format=flowed, */* 2602 </pre><p id="rfc.section. 9.1.p.15">have the following precedence: </p>2678 </pre><p id="rfc.section.10.1.p.15">have the following precedence: </p> 2603 2679 <ol> 2604 2680 <li>text/plain;format=flowed</li> … … 2607 2683 <li>*/*</li> 2608 2684 </ol> 2609 <p id="rfc.section. 9.1.p.16">The media type quality factor associated with a given type is determined by finding the media range with the highest precedence2685 <p id="rfc.section.10.1.p.16">The media type quality factor associated with a given type is determined by finding the media range with the highest precedence 2610 2686 which matches that type. For example, 2611 2687 </p> 2612 2688 <div id="rfc.figure.u.27"></div><pre class="text"> Accept: text/*;q=0.3, text/html;q=0.7, text/html;level=1, 2613 2689 text/html;level=2;q=0.4, */*;q=0.5 2614 </pre><p id="rfc.section. 9.1.p.18">would cause the following values to be associated:</p>2690 </pre><p id="rfc.section.10.1.p.18">would cause the following values to be associated:</p> 2615 2691 <div id="rfc.table.u.7"> 2616 2692 <table class="tt full left" cellpadding="3" cellspacing="0"> … … 2649 2725 </table> 2650 2726 </div> 2651 <p id="rfc.section. 9.1.p.19"> <b>Note:</b> A user agent might be provided with a default set of quality values for certain media ranges. However, unless the user agent2727 <p id="rfc.section.10.1.p.19"> <b>Note:</b> A user agent might be provided with a default set of quality values for certain media ranges. However, unless the user agent 2652 2728 is a closed system which cannot interact with other rendering agents, this default set ought to be configurable by the user. 2653 2729 </p> 2654 2730 <div id="rfc.iref.a.2"></div> 2655 2731 <div id="rfc.iref.h.3"></div> 2656 <h2 id="rfc.section. 9.2"><a href="#rfc.section.9.2">9.2</a> <a id="header.accept-charset" href="#header.accept-charset">Accept-Charset</a></h2>2657 <p id="rfc.section. 9.2.p.1">The "Accept-Charset" header field can be used by user agents to indicate what character encodings are acceptable in a response2732 <h2 id="rfc.section.10.2"><a href="#rfc.section.10.2">10.2</a> <a id="header.accept-charset" href="#header.accept-charset">Accept-Charset</a></h2> 2733 <p id="rfc.section.10.2.p.1">The "Accept-Charset" header field can be used by user agents to indicate what character encodings are acceptable in a response 2658 2734 payload. This field allows clients capable of understanding more comprehensive or special-purpose character encodings to signal 2659 2735 that capability to a server which is capable of representing documents in those character encodings. 2660 2736 </p> 2661 2737 <div id="rfc.figure.u.28"></div><pre class="inline"><span id="rfc.iref.g.37"></span> <a href="#header.accept-charset" class="smpl">Accept-Charset</a> = 1#( ( <a href="#rule.charset" class="smpl">charset</a> / "*" ) [ <a href="#quality.values" class="smpl">weight</a> ] ) 2662 </pre><p id="rfc.section. 9.2.p.3">Character encoding values (a.k.a., charsets) are described in <a href="#character.sets" title="Character Encodings (charset)">Section 5.3</a>. Each charset <em class="bcp14">MAY</em> be given an associated quality value which represents the user's preference for that charset, as defined in <a href="#quality.values" title="Quality Values">Section 8.3</a>. An example is2738 </pre><p id="rfc.section.10.2.p.3">Character encoding values (a.k.a., charsets) are described in <a href="#character.sets" title="Character Encodings (charset)">Section 6.3</a>. Each charset <em class="bcp14">MAY</em> be given an associated quality value which represents the user's preference for that charset, as defined in <a href="#quality.values" title="Quality Values">Section 9.3</a>. An example is 2663 2739 </p> 2664 2740 <div id="rfc.figure.u.29"></div><pre class="text"> Accept-Charset: iso-8859-5, unicode-1-1;q=0.8 2665 </pre><p id="rfc.section. 9.2.p.5">The special value "*", if present in the Accept-Charset field, matches every character encoding which is not mentioned elsewhere2741 </pre><p id="rfc.section.10.2.p.5">The special value "*", if present in the Accept-Charset field, matches every character encoding which is not mentioned elsewhere 2666 2742 in the Accept-Charset field. If no "*" is present in an Accept-Charset field, then any character encodings not explicitly 2667 2743 mentioned in the field are considered "not acceptable" to the client. 2668 2744 </p> 2669 <p id="rfc.section. 9.2.p.6">A request without any Accept-Charset header field implies that the user agent will accept any character encoding in response.</p>2670 <p id="rfc.section. 9.2.p.7">If an Accept-Charset header field is present in a request and none of the available representations for the response have2745 <p id="rfc.section.10.2.p.6">A request without any Accept-Charset header field implies that the user agent will accept any character encoding in response.</p> 2746 <p id="rfc.section.10.2.p.7">If an Accept-Charset header field is present in a request and none of the available representations for the response have 2671 2747 a character encoding that is listed as acceptable, the origin server <em class="bcp14">MAY</em> either honor the Accept-Charset header field by sending a <a href="#status.406" class="smpl">406 (Not Acceptable)</a> response or disregard the Accept-Charset header field by treating the response as if it is not subject to content negotiation. 2672 2748 </p> 2673 2749 <div id="rfc.iref.a.3"></div> 2674 2750 <div id="rfc.iref.h.4"></div> 2675 <h2 id="rfc.section. 9.3"><a href="#rfc.section.9.3">9.3</a> <a id="header.accept-encoding" href="#header.accept-encoding">Accept-Encoding</a></h2>2676 <p id="rfc.section. 9.3.p.1">The "Accept-Encoding" header field can be used by user agents to indicate what response content-codings (<a href="#content.codings" title="Content Codings">Section 5.4</a>) are acceptable in the response. An "identity" token is used as a synonym for "no encoding" in order to communicate when2751 <h2 id="rfc.section.10.3"><a href="#rfc.section.10.3">10.3</a> <a id="header.accept-encoding" href="#header.accept-encoding">Accept-Encoding</a></h2> 2752 <p id="rfc.section.10.3.p.1">The "Accept-Encoding" header field can be used by user agents to indicate what response content-codings (<a href="#content.codings" title="Content Codings">Section 6.4</a>) are acceptable in the response. An "identity" token is used as a synonym for "no encoding" in order to communicate when 2677 2753 no encoding is preferred. 2678 2754 </p> 2679 2755 <div id="rfc.figure.u.30"></div><pre class="inline"><span id="rfc.iref.g.38"></span><span id="rfc.iref.g.39"></span> <a href="#header.accept-encoding" class="smpl">Accept-Encoding</a> = #( <a href="#header.accept-encoding" class="smpl">codings</a> [ <a href="#quality.values" class="smpl">weight</a> ] ) 2680 2756 <a href="#header.accept-encoding" class="smpl">codings</a> = <a href="#content.codings" class="smpl">content-coding</a> / "identity" / "*" 2681 </pre><p id="rfc.section. 9.3.p.3">Each codings value <em class="bcp14">MAY</em> be given an associated quality value which represents the preference for that encoding, as defined in <a href="#quality.values" title="Quality Values">Section 8.3</a>.2682 </p> 2683 <p id="rfc.section. 9.3.p.4">For example,</p>2757 </pre><p id="rfc.section.10.3.p.3">Each codings value <em class="bcp14">MAY</em> be given an associated quality value which represents the preference for that encoding, as defined in <a href="#quality.values" title="Quality Values">Section 9.3</a>. 2758 </p> 2759 <p id="rfc.section.10.3.p.4">For example,</p> 2684 2760 <div id="rfc.figure.u.31"></div><pre class="text"> Accept-Encoding: compress, gzip 2685 2761 Accept-Encoding: … … 2687 2763 Accept-Encoding: compress;q=0.5, gzip;q=1.0 2688 2764 Accept-Encoding: gzip;q=1.0, identity; q=0.5, *;q=0 2689 </pre><p id="rfc.section. 9.3.p.6">A server tests whether a content-coding for a given representation is acceptable, according to an Accept-Encoding field, using2765 </pre><p id="rfc.section.10.3.p.6">A server tests whether a content-coding for a given representation is acceptable, according to an Accept-Encoding field, using 2690 2766 these rules: 2691 2767 </p> … … 2698 2774 </li> 2699 2775 <li>If the representation's content-coding is one of the content-codings listed in the Accept-Encoding field, then it is acceptable 2700 unless it is accompanied by a qvalue of 0. (As defined in <a href="#quality.values" title="Quality Values">Section 8.3</a>, a qvalue of 0 means "not acceptable".)2776 unless it is accompanied by a qvalue of 0. (As defined in <a href="#quality.values" title="Quality Values">Section 9.3</a>, a qvalue of 0 means "not acceptable".) 2701 2777 </li> 2702 2778 <li>If multiple content-codings are acceptable, then the acceptable content-coding with the highest non-zero qvalue is preferred.</li> 2703 2779 </ol> 2704 <p id="rfc.section. 9.3.p.7">An Accept-Encoding header field with a combined field-value that is empty implies that the user agent does not want any content-coding2780 <p id="rfc.section.10.3.p.7">An Accept-Encoding header field with a combined field-value that is empty implies that the user agent does not want any content-coding 2705 2781 in response. If an Accept-Encoding header field is present in a request and none of the available representations for the 2706 2782 response have a content-coding that is listed as acceptable, the origin server <em class="bcp14">SHOULD</em> send a response without any content-coding. 2707 2783 </p> 2708 <p id="rfc.section. 9.3.p.8">A request without an Accept-Encoding header field implies that the user agent will accept any content-coding in response.</p>2709 <div class="note" id="rfc.section. 9.3.p.9">2784 <p id="rfc.section.10.3.p.8">A request without an Accept-Encoding header field implies that the user agent will accept any content-coding in response.</p> 2785 <div class="note" id="rfc.section.10.3.p.9"> 2710 2786 <p> <b>Note:</b> Most HTTP/1.0 applications do not recognize or obey qvalues associated with content-codings. This means that qvalues will 2711 2787 not work and are not permitted with x-gzip or x-compress. … … 2714 2790 <div id="rfc.iref.a.4"></div> 2715 2791 <div id="rfc.iref.h.5"></div> 2716 <h2 id="rfc.section. 9.4"><a href="#rfc.section.9.4">9.4</a> <a id="header.accept-language" href="#header.accept-language">Accept-Language</a></h2>2717 <p id="rfc.section. 9.4.p.1">The "Accept-Language" header field can be used by user agents to indicate the set of natural languages that are preferred2718 in the response. Language tags are defined in <a href="#language.tags" title="Language Tags">Section 5.6</a>.2792 <h2 id="rfc.section.10.4"><a href="#rfc.section.10.4">10.4</a> <a id="header.accept-language" href="#header.accept-language">Accept-Language</a></h2> 2793 <p id="rfc.section.10.4.p.1">The "Accept-Language" header field can be used by user agents to indicate the set of natural languages that are preferred 2794 in the response. Language tags are defined in <a href="#language.tags" title="Language Tags">Section 6.6</a>. 2719 2795 </p> 2720 2796 <div id="rfc.figure.u.32"></div><pre class="inline"><span id="rfc.iref.g.40"></span><span id="rfc.iref.g.41"></span> <a href="#header.accept-language" class="smpl">Accept-Language</a> = 1#( <a href="#header.accept-language" class="smpl">language-range</a> [ <a href="#quality.values" class="smpl">weight</a> ] ) 2721 2797 <a href="#header.accept-language" class="smpl">language-range</a> = 2722 2798 <language-range, defined in <a href="#RFC4647" id="rfc.xref.RFC4647.1"><cite title="Matching of Language Tags">[RFC4647]</cite></a>, <a href="http://tools.ietf.org/html/rfc4647#section-2.1">Section 2.1</a>> 2723 </pre><p id="rfc.section. 9.4.p.3">Each language-range can be given an associated quality value which represents an estimate of the user's preference for the2724 languages specified by that range, as defined in <a href="#quality.values" title="Quality Values">Section 8.3</a>. For example,2799 </pre><p id="rfc.section.10.4.p.3">Each language-range can be given an associated quality value which represents an estimate of the user's preference for the 2800 languages specified by that range, as defined in <a href="#quality.values" title="Quality Values">Section 9.3</a>. For example, 2725 2801 </p> 2726 2802 <div id="rfc.figure.u.33"></div><pre class="text"> Accept-Language: da, en-gb;q=0.8, en;q=0.7 2727 </pre><p id="rfc.section. 9.4.p.5">would mean: "I prefer Danish, but will accept British English and other types of English". (see also <a href="http://tools.ietf.org/html/rfc4647#section-2.3">Section 2.3</a> of <a href="#RFC4647" id="rfc.xref.RFC4647.2"><cite title="Matching of Language Tags">[RFC4647]</cite></a>)2728 </p> 2729 <p id="rfc.section. 9.4.p.6">For matching, <a href="http://tools.ietf.org/html/rfc4647#section-3">Section 3</a> of <a href="#RFC4647" id="rfc.xref.RFC4647.3"><cite title="Matching of Language Tags">[RFC4647]</cite></a> defines several matching schemes. Implementations can offer the most appropriate matching scheme for their requirements.2730 </p> 2731 <div class="note" id="rfc.section. 9.4.p.7">2732 <p> <b>Note:</b> The "Basic Filtering" scheme (<a href="#RFC4647" id="rfc.xref.RFC4647.4"><cite title="Matching of Language Tags">[RFC4647]</cite></a>, <a href="http://tools.ietf.org/html/rfc4647#section-3.3.1">Section 3.3.1</a>) is identical to the matching scheme that was previously defined in <a href="http://tools.ietf.org/html/rfc2616#section-14.4">Section 14.4</a> of <a href="#RFC2616" id="rfc.xref.RFC2616. 3"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a>.2803 </pre><p id="rfc.section.10.4.p.5">would mean: "I prefer Danish, but will accept British English and other types of English". (see also <a href="http://tools.ietf.org/html/rfc4647#section-2.3">Section 2.3</a> of <a href="#RFC4647" id="rfc.xref.RFC4647.2"><cite title="Matching of Language Tags">[RFC4647]</cite></a>) 2804 </p> 2805 <p id="rfc.section.10.4.p.6">For matching, <a href="http://tools.ietf.org/html/rfc4647#section-3">Section 3</a> of <a href="#RFC4647" id="rfc.xref.RFC4647.3"><cite title="Matching of Language Tags">[RFC4647]</cite></a> defines several matching schemes. Implementations can offer the most appropriate matching scheme for their requirements. 2806 </p> 2807 <div class="note" id="rfc.section.10.4.p.7"> 2808 <p> <b>Note:</b> The "Basic Filtering" scheme (<a href="#RFC4647" id="rfc.xref.RFC4647.4"><cite title="Matching of Language Tags">[RFC4647]</cite></a>, <a href="http://tools.ietf.org/html/rfc4647#section-3.3.1">Section 3.3.1</a>) is identical to the matching scheme that was previously defined in <a href="http://tools.ietf.org/html/rfc2616#section-14.4">Section 14.4</a> of <a href="#RFC2616" id="rfc.xref.RFC2616.2"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a>. 2733 2809 </p> 2734 2810 </div> 2735 <p id="rfc.section. 9.4.p.8">It might be contrary to the privacy expectations of the user to send an Accept-Language header field with the complete linguistic2736 preferences of the user in every request. For a discussion of this issue, see <a href="#privacy.issues.connected.to.accept.header.fields" title="Privacy Issues Connected to Accept Header Fields">Section 1 1.5</a>.2737 </p> 2738 <p id="rfc.section. 9.4.p.9">As intelligibility is highly dependent on the individual user, it is recommended that client applications make the choice2811 <p id="rfc.section.10.4.p.8">It might be contrary to the privacy expectations of the user to send an Accept-Language header field with the complete linguistic 2812 preferences of the user in every request. For a discussion of this issue, see <a href="#privacy.issues.connected.to.accept.header.fields" title="Privacy Issues Connected to Accept Header Fields">Section 12.5</a>. 2813 </p> 2814 <p id="rfc.section.10.4.p.9">As intelligibility is highly dependent on the individual user, it is recommended that client applications make the choice 2739 2815 of linguistic preference available to the user. If the choice is not made available, then the Accept-Language header field <em class="bcp14">MUST NOT</em> be given in the request. 2740 2816 </p> 2741 <div class="note" id="rfc.section. 9.4.p.10">2817 <div class="note" id="rfc.section.10.4.p.10"> 2742 2818 <p> <b>Note:</b> When making the choice of linguistic preference available to the user, we remind implementers of the fact that users are not 2743 2819 familiar with the details of language matching as described above, and ought to be provided appropriate guidance. As an example, … … 2748 2824 <div id="rfc.iref.a.5"></div> 2749 2825 <div id="rfc.iref.h.6"></div> 2750 <h2 id="rfc.section. 9.5"><a href="#rfc.section.9.5">9.5</a> <a id="header.allow" href="#header.allow">Allow</a></h2>2751 <p id="rfc.section. 9.5.p.1">The "Allow" header field lists the set of methods advertised as supported by the target resource. The purpose of this field2826 <h2 id="rfc.section.10.5"><a href="#rfc.section.10.5">10.5</a> <a id="header.allow" href="#header.allow">Allow</a></h2> 2827 <p id="rfc.section.10.5.p.1">The "Allow" header field lists the set of methods advertised as supported by the target resource. The purpose of this field 2752 2828 is strictly to inform the recipient of valid request methods associated with the resource. 2753 2829 </p> 2754 2830 <div id="rfc.figure.u.34"></div><pre class="inline"><span id="rfc.iref.g.42"></span> <a href="#header.allow" class="smpl">Allow</a> = #<a href="#methods" class="smpl">method</a> 2755 </pre><p id="rfc.section. 9.5.p.3">Example of use:</p>2831 </pre><p id="rfc.section.10.5.p.3">Example of use:</p> 2756 2832 <div id="rfc.figure.u.35"></div><pre class="text"> Allow: GET, HEAD, PUT 2757 </pre><p id="rfc.section. 9.5.p.5">The actual set of allowed methods is defined by the origin server at the time of each request.</p>2758 <p id="rfc.section. 9.5.p.6">A proxy <em class="bcp14">MUST NOT</em> modify the Allow header field — it does not need to understand all the methods specified in order to handle them according2833 </pre><p id="rfc.section.10.5.p.5">The actual set of allowed methods is defined by the origin server at the time of each request.</p> 2834 <p id="rfc.section.10.5.p.6">A proxy <em class="bcp14">MUST NOT</em> modify the Allow header field — it does not need to understand all the methods specified in order to handle them according 2759 2835 to the generic message handling rules. 2760 2836 </p> 2761 2837 <div id="rfc.iref.c.7"></div> 2762 2838 <div id="rfc.iref.h.7"></div> 2763 <h2 id="rfc.section. 9.6"><a href="#rfc.section.9.6">9.6</a> <a id="header.content-encoding" href="#header.content-encoding">Content-Encoding</a></h2>2764 <p id="rfc.section. 9.6.p.1">The "Content-Encoding" header field indicates what content-codings have been applied to the representation beyond those inherent2839 <h2 id="rfc.section.10.6"><a href="#rfc.section.10.6">10.6</a> <a id="header.content-encoding" href="#header.content-encoding">Content-Encoding</a></h2> 2840 <p id="rfc.section.10.6.p.1">The "Content-Encoding" header field indicates what content-codings have been applied to the representation beyond those inherent 2765 2841 in the media type, and thus what decoding mechanisms have to be applied in order to obtain the media-type referenced by the <a href="#header.content-type" class="smpl">Content-Type</a> header field. Content-Encoding is primarily used to allow a representation to be compressed without losing the identity of 2766 2842 its underlying media type. 2767 2843 </p> 2768 2844 <div id="rfc.figure.u.36"></div><pre class="inline"><span id="rfc.iref.g.43"></span> <a href="#header.content-encoding" class="smpl">Content-Encoding</a> = 1#<a href="#content.codings" class="smpl">content-coding</a> 2769 </pre><p id="rfc.section. 9.6.p.3">Content codings are defined in <a href="#content.codings" title="Content Codings">Section 5.4</a>. An example of its use is2845 </pre><p id="rfc.section.10.6.p.3">Content codings are defined in <a href="#content.codings" title="Content Codings">Section 6.4</a>. An example of its use is 2770 2846 </p> 2771 2847 <div id="rfc.figure.u.37"></div><pre class="text"> Content-Encoding: gzip 2772 </pre><p id="rfc.section. 9.6.p.5">The content-coding is a characteristic of the representation. Typically, the representation body is stored with this encoding2848 </pre><p id="rfc.section.10.6.p.5">The content-coding is a characteristic of the representation. Typically, the representation body is stored with this encoding 2773 2849 and is only decoded before rendering or analogous usage. However, a transforming proxy <em class="bcp14">MAY</em> modify the content-coding if the new coding is known to be acceptable to the recipient, unless the "no-transform" cache-control 2774 2850 directive is present in the message. 2775 2851 </p> 2776 <p id="rfc.section. 9.6.p.6">If the media type includes an inherent encoding, such as a data format that is always compressed, then that encoding would2852 <p id="rfc.section.10.6.p.6">If the media type includes an inherent encoding, such as a data format that is always compressed, then that encoding would 2777 2853 not be restated as a Content-Encoding even if it happens to be the same algorithm as one of the content-codings. Such a content-coding 2778 2854 would only be listed if, for some bizarre reason, it is applied a second time to form the representation. Likewise, an origin … … 2781 2857 as ..." dialog instead of automatic decompression and rendering of content). 2782 2858 </p> 2783 <p id="rfc.section. 9.6.p.7">A representation that has a content-coding applied to it <em class="bcp14">MUST</em> include a Content-Encoding header field that lists the content-coding(s) applied.2784 </p> 2785 <p id="rfc.section. 9.6.p.8">If multiple encodings have been applied to a representation, the content codings <em class="bcp14">MUST</em> be listed in the order in which they were applied. Additional information about the encoding parameters <em class="bcp14">MAY</em> be provided by other header fields not defined by this specification.2786 </p> 2787 <p id="rfc.section. 9.6.p.9">If the content-coding of a representation in a request message is not acceptable to the origin server, the server <em class="bcp14">SHOULD</em> respond with a status code of 415 (Unsupported Media Type).2859 <p id="rfc.section.10.6.p.7">A representation that has a content-coding applied to it <em class="bcp14">MUST</em> include a Content-Encoding header field that lists the content-coding(s) applied. 2860 </p> 2861 <p id="rfc.section.10.6.p.8">If multiple encodings have been applied to a representation, the content codings <em class="bcp14">MUST</em> be listed in the order in which they were applied. Additional information about the encoding parameters <em class="bcp14">MAY</em> be provided by other header fields not defined by this specification. 2862 </p> 2863 <p id="rfc.section.10.6.p.9">If the content-coding of a representation in a request message is not acceptable to the origin server, the server <em class="bcp14">SHOULD</em> respond with a status code of 415 (Unsupported Media Type). 2788 2864 </p> 2789 2865 <div id="rfc.iref.c.8"></div> 2790 2866 <div id="rfc.iref.h.8"></div> 2791 <h2 id="rfc.section. 9.7"><a href="#rfc.section.9.7">9.7</a> <a id="header.content-language" href="#header.content-language">Content-Language</a></h2>2792 <p id="rfc.section. 9.7.p.1">The "Content-Language" header field describes the natural language(s) of the intended audience for the representation. Note2867 <h2 id="rfc.section.10.7"><a href="#rfc.section.10.7">10.7</a> <a id="header.content-language" href="#header.content-language">Content-Language</a></h2> 2868 <p id="rfc.section.10.7.p.1">The "Content-Language" header field describes the natural language(s) of the intended audience for the representation. Note 2793 2869 that this might not be equivalent to all the languages used within the representation. 2794 2870 </p> 2795 2871 <div id="rfc.figure.u.38"></div><pre class="inline"><span id="rfc.iref.g.44"></span> <a href="#header.content-language" class="smpl">Content-Language</a> = 1#<a href="#language.tags" class="smpl">language-tag</a> 2796 </pre><p id="rfc.section. 9.7.p.3">Language tags are defined in <a href="#language.tags" title="Language Tags">Section 5.6</a>. The primary purpose of Content-Language is to allow a user to identify and differentiate representations according to the2872 </pre><p id="rfc.section.10.7.p.3">Language tags are defined in <a href="#language.tags" title="Language Tags">Section 6.6</a>. The primary purpose of Content-Language is to allow a user to identify and differentiate representations according to the 2797 2873 user's own preferred language. Thus, if the body content is intended only for a Danish-literate audience, the appropriate 2798 2874 field is 2799 2875 </p> 2800 2876 <div id="rfc.figure.u.39"></div><pre class="text"> Content-Language: da 2801 </pre><p id="rfc.section. 9.7.p.5">If no Content-Language is specified, the default is that the content is intended for all language audiences. This might mean2877 </pre><p id="rfc.section.10.7.p.5">If no Content-Language is specified, the default is that the content is intended for all language audiences. This might mean 2802 2878 that the sender does not consider it to be specific to any natural language, or that the sender does not know for which language 2803 2879 it is intended. 2804 2880 </p> 2805 <p id="rfc.section. 9.7.p.6">Multiple languages <em class="bcp14">MAY</em> be listed for content that is intended for multiple audiences. For example, a rendition of the "Treaty of Waitangi", presented2881 <p id="rfc.section.10.7.p.6">Multiple languages <em class="bcp14">MAY</em> be listed for content that is intended for multiple audiences. For example, a rendition of the "Treaty of Waitangi", presented 2806 2882 simultaneously in the original Maori and English versions, would call for 2807 2883 </p> 2808 2884 <div id="rfc.figure.u.40"></div><pre class="text"> Content-Language: mi, en 2809 </pre><p id="rfc.section. 9.7.p.8">However, just because multiple languages are present within a representation does not mean that it is intended for multiple2885 </pre><p id="rfc.section.10.7.p.8">However, just because multiple languages are present within a representation does not mean that it is intended for multiple 2810 2886 linguistic audiences. An example would be a beginner's language primer, such as "A First Lesson in Latin", which is clearly 2811 2887 intended to be used by an English-literate audience. In this case, the Content-Language would properly only include "en". 2812 2888 </p> 2813 <p id="rfc.section. 9.7.p.9">Content-Language <em class="bcp14">MAY</em> be applied to any media type — it is not limited to textual documents.2889 <p id="rfc.section.10.7.p.9">Content-Language <em class="bcp14">MAY</em> be applied to any media type — it is not limited to textual documents. 2814 2890 </p> 2815 2891 <div id="rfc.iref.c.9"></div> 2816 2892 <div id="rfc.iref.h.9"></div> 2817 <h2 id="rfc.section. 9.8"><a href="#rfc.section.9.8">9.8</a> <a id="header.content-location" href="#header.content-location">Content-Location</a></h2>2818 <p id="rfc.section. 9.8.p.1">The "Content-Location" header field supplies a URI that can be used as a specific identifier for the representation in this2893 <h2 id="rfc.section.10.8"><a href="#rfc.section.10.8">10.8</a> <a id="header.content-location" href="#header.content-location">Content-Location</a></h2> 2894 <p id="rfc.section.10.8.p.1">The "Content-Location" header field supplies a URI that can be used as a specific identifier for the representation in this 2819 2895 message. In other words, if one were to perform a GET on this URI at the time of this message's generation, then a <a href="#status.200" class="smpl">200 (OK)</a> response would contain the same representation that is enclosed as payload in this message. 2820 2896 </p> 2821 2897 <div id="rfc.figure.u.41"></div><pre class="inline"><span id="rfc.iref.g.45"></span> <a href="#header.content-location" class="smpl">Content-Location</a> = <a href="#imported.abnf" class="smpl">absolute-URI</a> / <a href="#imported.abnf" class="smpl">partial-URI</a> 2822 </pre><p id="rfc.section. 9.8.p.3">The Content-Location value is not a replacement for the effective Request URI (<a href="p1-messaging.html#effective.request.uri" title="Effective Request URI">Section 5.5</a> of <a href="#Part1" id="rfc.xref.Part1.34"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>). It is representation metadata. It has the same syntax and semantics as the header field of the same name defined for MIME2898 </pre><p id="rfc.section.10.8.p.3">The Content-Location value is not a replacement for the effective Request URI (<a href="p1-messaging.html#effective.request.uri" title="Effective Request URI">Section 5.5</a> of <a href="#Part1" id="rfc.xref.Part1.36"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>). It is representation metadata. It has the same syntax and semantics as the header field of the same name defined for MIME 2823 2899 body parts in <a href="http://tools.ietf.org/html/rfc2557#section-4">Section 4</a> of <a href="#RFC2557" id="rfc.xref.RFC2557.1"><cite title="MIME Encapsulation of Aggregate Documents, such as HTML (MHTML)">[RFC2557]</cite></a>. However, its appearance in an HTTP message has some special implications for HTTP recipients. 2824 2900 </p> 2825 <p id="rfc.section. 9.8.p.4">If Content-Location is included in a response message and its value is the same as the effective request URI, then the response2901 <p id="rfc.section.10.8.p.4">If Content-Location is included in a response message and its value is the same as the effective request URI, then the response 2826 2902 payload <em class="bcp14">SHOULD</em> be considered a current representation of that resource. For a GET or HEAD request, this is the same as the default semantics 2827 2903 when no Content-Location is provided by the server. For a state-changing request like PUT or POST, it implies that the server's … … 2830 2906 need for a subsequent GET request. 2831 2907 </p> 2832 <p id="rfc.section. 9.8.p.5">If Content-Location is included in a response message and its value differs from the effective request URI, then the origin2908 <p id="rfc.section.10.8.p.5">If Content-Location is included in a response message and its value differs from the effective request URI, then the origin 2833 2909 server is informing recipients that this representation has its own, presumably more specific, identifier. For a GET or HEAD 2834 2910 request, this is an indication that the effective request URI identifies a resource that is subject to content negotiation … … 2838 2914 the payload of the <a href="#status.200" class="smpl">200 (OK)</a> response; the Content-Location value provides an identifier for retrieving a copy of that same receipt in the future. 2839 2915 </p> 2840 <p id="rfc.section. 9.8.p.6">If Content-Location is included in a request message, then it <em class="bcp14">MAY</em> be interpreted by the origin server as an indication of where the user agent originally obtained the content of the enclosed2916 <p id="rfc.section.10.8.p.6">If Content-Location is included in a request message, then it <em class="bcp14">MAY</em> be interpreted by the origin server as an indication of where the user agent originally obtained the content of the enclosed 2841 2917 representation (prior to any subsequent modification of the content by that user agent). In other words, the user agent is 2842 2918 providing the same representation metadata that it received with the original representation. However, such interpretation <em class="bcp14">MUST NOT</em> be used to alter the semantics of the method requested by the client. For example, if a client makes a PUT request on a negotiated … … 2846 2922 latter semantics, it would have applied the PUT directly to the Content-Location URI. 2847 2923 </p> 2848 <p id="rfc.section. 9.8.p.7">A Content-Location field received in a request message is transitory information that <em class="bcp14">SHOULD NOT</em> be saved with other representation metadata for use in later responses. The Content-Location's value might be saved for use2924 <p id="rfc.section.10.8.p.7">A Content-Location field received in a request message is transitory information that <em class="bcp14">SHOULD NOT</em> be saved with other representation metadata for use in later responses. The Content-Location's value might be saved for use 2849 2925 in other contexts, such as within source links or other metadata. 2850 2926 </p> 2851 <p id="rfc.section. 9.8.p.8">A cache cannot assume that a representation with a Content-Location different from the URI used to retrieve it can be used2927 <p id="rfc.section.10.8.p.8">A cache cannot assume that a representation with a Content-Location different from the URI used to retrieve it can be used 2852 2928 to respond to later requests on that Content-Location URI. 2853 2929 </p> 2854 <p id="rfc.section. 9.8.p.9">If the Content-Location value is a partial URI, the partial URI is interpreted relative to the effective request URI.</p>2930 <p id="rfc.section.10.8.p.9">If the Content-Location value is a partial URI, the partial URI is interpreted relative to the effective request URI.</p> 2855 2931 <div id="rfc.iref.c.10"></div> 2856 2932 <div id="rfc.iref.h.10"></div> 2857 <h2 id="rfc.section. 9.9"><a href="#rfc.section.9.9">9.9</a> <a id="header.content-type" href="#header.content-type">Content-Type</a></h2>2858 <p id="rfc.section. 9.9.p.1">The "Content-Type" header field indicates the media type of the representation. In the case of responses to the HEAD method,2933 <h2 id="rfc.section.10.9"><a href="#rfc.section.10.9">10.9</a> <a id="header.content-type" href="#header.content-type">Content-Type</a></h2> 2934 <p id="rfc.section.10.9.p.1">The "Content-Type" header field indicates the media type of the representation. In the case of responses to the HEAD method, 2859 2935 the media type is that which would have been sent had the request been a GET. 2860 2936 </p> 2861 2937 <div id="rfc.figure.u.42"></div><pre class="inline"><span id="rfc.iref.g.46"></span> <a href="#header.content-type" class="smpl">Content-Type</a> = <a href="#media.types" class="smpl">media-type</a> 2862 </pre><p id="rfc.section. 9.9.p.3">Media types are defined in <a href="#media.types" title="Media Types">Section 5.5</a>. An example of the field is2938 </pre><p id="rfc.section.10.9.p.3">Media types are defined in <a href="#media.types" title="Media Types">Section 6.5</a>. An example of the field is 2863 2939 </p> 2864 2940 <div id="rfc.figure.u.43"></div><pre class="text"> Content-Type: text/html; charset=ISO-8859-4 2865 </pre><p id="rfc.section. 9.9.p.5">Further discussion of Content-Type is provided in <a href="#representation.data" title="Representation Data">Section 7.3</a>.2941 </pre><p id="rfc.section.10.9.p.5">Further discussion of Content-Type is provided in <a href="#representation.data" title="Representation Data">Section 8.3</a>. 2866 2942 </p> 2867 2943 <div id="rfc.iref.d.3"></div> 2868 2944 <div id="rfc.iref.h.11"></div> 2869 <h2 id="rfc.section. 9.10"><a href="#rfc.section.9.10">9.10</a> <a id="header.date" href="#header.date">Date</a></h2>2870 <p id="rfc.section. 9.10.p.1">The "Date" header field represents the date and time at which the message was originated, having the same semantics as the2871 Origination Date Field (orig-date) defined in <a href="http://tools.ietf.org/html/rfc5322#section-3.6.1">Section 3.6.1</a> of <a href="#RFC5322" id="rfc.xref.RFC5322.2"><cite title="Internet Message Format">[RFC5322]</cite></a>. The field value is an HTTP-date, as defined in <a href="#http.date" title="Date/Time Formats">Section 5.1</a>; it <em class="bcp14">MUST</em> be sent in rfc1123-date format.2945 <h2 id="rfc.section.10.10"><a href="#rfc.section.10.10">10.10</a> <a id="header.date" href="#header.date">Date</a></h2> 2946 <p id="rfc.section.10.10.p.1">The "Date" header field represents the date and time at which the message was originated, having the same semantics as the 2947 Origination Date Field (orig-date) defined in <a href="http://tools.ietf.org/html/rfc5322#section-3.6.1">Section 3.6.1</a> of <a href="#RFC5322" id="rfc.xref.RFC5322.2"><cite title="Internet Message Format">[RFC5322]</cite></a>. The field value is an HTTP-date, as defined in <a href="#http.date" title="Date/Time Formats">Section 6.1</a>; it <em class="bcp14">MUST</em> be sent in rfc1123-date format. 2872 2948 </p> 2873 2949 <div id="rfc.figure.u.44"></div><pre class="inline"><span id="rfc.iref.g.47"></span> <a href="#header.date" class="smpl">Date</a> = <a href="#http.date" class="smpl">HTTP-date</a> 2874 </pre><p id="rfc.section. 9.10.p.3">An example is</p>2950 </pre><p id="rfc.section.10.10.p.3">An example is</p> 2875 2951 <div id="rfc.figure.u.45"></div><pre class="text"> Date: Tue, 15 Nov 1994 08:12:31 GMT 2876 </pre><p id="rfc.section. 9.10.p.5">Origin servers <em class="bcp14">MUST</em> include a Date header field in all responses, except in these cases:2952 </pre><p id="rfc.section.10.10.p.5">Origin servers <em class="bcp14">MUST</em> include a Date header field in all responses, except in these cases: 2877 2953 </p> 2878 2954 <ol> … … 2885 2961 </li> 2886 2962 </ol> 2887 <p id="rfc.section. 9.10.p.6">A received message that does not have a Date header field <em class="bcp14">MUST</em> be assigned one by the recipient if the message will be cached by that recipient.2888 </p> 2889 <p id="rfc.section. 9.10.p.7">Clients can use the Date header field as well; in order to keep request messages small, they are advised not to include it2963 <p id="rfc.section.10.10.p.6">A received message that does not have a Date header field <em class="bcp14">MUST</em> be assigned one by the recipient if the message will be cached by that recipient. 2964 </p> 2965 <p id="rfc.section.10.10.p.7">Clients can use the Date header field as well; in order to keep request messages small, they are advised not to include it 2890 2966 when it doesn't convey any useful information (as is usually the case for requests that do not contain a payload). 2891 2967 </p> 2892 <p id="rfc.section. 9.10.p.8">The HTTP-date sent in a Date header field <em class="bcp14">SHOULD NOT</em> represent a date and time subsequent to the generation of the message. It <em class="bcp14">SHOULD</em> represent the best available approximation of the date and time of message generation, unless the implementation has no means2968 <p id="rfc.section.10.10.p.8">The HTTP-date sent in a Date header field <em class="bcp14">SHOULD NOT</em> represent a date and time subsequent to the generation of the message. It <em class="bcp14">SHOULD</em> represent the best available approximation of the date and time of message generation, unless the implementation has no means 2893 2969 of generating a reasonably accurate date and time. In theory, the date ought to represent the moment just before the payload 2894 2970 is generated. In practice, the date can be generated at any time during the message origination without affecting its semantic … … 2897 2973 <div id="rfc.iref.e.1"></div> 2898 2974 <div id="rfc.iref.h.12"></div> 2899 <h2 id="rfc.section. 9.11"><a href="#rfc.section.9.11">9.11</a> <a id="header.expect" href="#header.expect">Expect</a></h2>2900 <p id="rfc.section. 9.11.p.1">The "Expect" header field is used to indicate that particular server behaviors are required by the client.</p>2975 <h2 id="rfc.section.10.11"><a href="#rfc.section.10.11">10.11</a> <a id="header.expect" href="#header.expect">Expect</a></h2> 2976 <p id="rfc.section.10.11.p.1">The "Expect" header field is used to indicate that particular server behaviors are required by the client.</p> 2901 2977 <div id="rfc.figure.u.46"></div><pre class="inline"><span id="rfc.iref.g.48"></span><span id="rfc.iref.g.49"></span><span id="rfc.iref.g.50"></span><span id="rfc.iref.g.51"></span><span id="rfc.iref.g.52"></span> <a href="#header.expect" class="smpl">Expect</a> = 1#<a href="#header.expect" class="smpl">expectation</a> 2902 2978 … … 2907 2983 <a href="#header.expect" class="smpl">expect-name</a> = <a href="#imported.abnf" class="smpl">token</a> 2908 2984 <a href="#header.expect" class="smpl">expect-value</a> = <a href="#imported.abnf" class="smpl">token</a> / <a href="#imported.abnf" class="smpl">quoted-string</a> 2909 </pre><p id="rfc.section. 9.11.p.3">If all received Expect header field(s) are syntactically valid but contain an expectation that the recipient does not understand2985 </pre><p id="rfc.section.10.11.p.3">If all received Expect header field(s) are syntactically valid but contain an expectation that the recipient does not understand 2910 2986 or cannot comply with, the recipient <em class="bcp14">MUST</em> respond with a <a href="#status.417" class="smpl">417 (Expectation Failed)</a> status code. A recipient of a syntactically invalid Expectation header field <em class="bcp14">MUST</em> respond with a <a href="#status.4xx" class="smpl">4xx</a> status code other than 417. 2911 2987 </p> 2912 <p id="rfc.section. 9.11.p.4">The only expectation defined by this specification is:</p>2913 <p id="rfc.section. 9.11.p.5"><span id="rfc.iref.141"></span><span id="rfc.iref.e.2"></span> 100-continue2988 <p id="rfc.section.10.11.p.4">The only expectation defined by this specification is:</p> 2989 <p id="rfc.section.10.11.p.5"><span id="rfc.iref.141"></span><span id="rfc.iref.e.2"></span> 100-continue 2914 2990 </p> 2915 2991 <ul class="empty"> 2916 <li>The "100-continue" expectation is defined <a href="p1-messaging.html#use.of.the.100.status" title="Use of the 100 (Continue) Status">Section 6. 4.3</a> of <a href="#Part1" id="rfc.xref.Part1.35"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>. It does not support any expect-params.2917 </li> 2918 </ul> 2919 <p id="rfc.section. 9.11.p.6">Comparison is case-insensitive for names (expect-name), and case-sensitive for values (expect-value).</p>2920 <p id="rfc.section. 9.11.p.7">The Expect mechanism is hop-by-hop: the above requirements apply to any server, including proxies. However, the Expect header2992 <li>The "100-continue" expectation is defined <a href="p1-messaging.html#use.of.the.100.status" title="Use of the 100 (Continue) Status">Section 6.3</a> of <a href="#Part1" id="rfc.xref.Part1.37"><cite title="HTTP/1.1, part 1: Message Routing and Syntax"">[Part1]</cite></a>. It does not support any expect-params. 2993 </li> 2994 </ul> 2995 <p id="rfc.section.10.11.p.6">Comparison is case-insensitive for names (expect-name), and case-sensitive for values (expect-value).</p> 2996 <p id="rfc.section.10.11.p.7">The Expect mechanism is hop-by-hop: the above requirements apply to any server, including proxies. However, the Expect header 2921 2997 field itself is end-to-end; it <em class="bcp14">MUST</em> be forwarded if the request is forwarded. 2922 2998 </p> 2923 <p id="rfc.section. 9.11.p.8">Many older HTTP/1.0 and HTTP/1.1 applications do not understand the Expect header field.</p>2999 <p id="rfc.section.10.11.p.8">Many older HTTP/1.0 and HTTP/1.1 applications do not understand the Expect header field.</p> 2924 3000 <div id="rfc.iref.f.1"></div> 2925 3001 <div id="rfc.iref.h.13"></div> 2926 <h2 id="rfc.section. 9.12"><a href="#rfc.section.9.12">9.12</a> <a id="header.from" href="#header.from">From</a></h2>2927 <p id="rfc.section. 9.12.p.1">The "From" header field, if given, <em class="bcp14">SHOULD</em> contain an Internet e-mail address for the human user who controls the requesting user agent. The address <em class="bcp14">SHOULD</em> be machine-usable, as defined by "mailbox" in <a href="http://tools.ietf.org/html/rfc5322#section-3.4">Section 3.4</a> of <a href="#RFC5322" id="rfc.xref.RFC5322.3"><cite title="Internet Message Format">[RFC5322]</cite></a>:3002 <h2 id="rfc.section.10.12"><a href="#rfc.section.10.12">10.12</a> <a id="header.from" href="#header.from">From</a></h2> 3003 <p id="rfc.section.10.12.p.1">The "From" header field, if given, <em class="bcp14">SHOULD</em> contain an Internet e-mail address for the human user who controls the requesting user agent. The address <em class="bcp14">SHOULD</em> be machine-usable, as defined by "mailbox" in <a href="http://tools.ietf.org/html/rfc5322#section-3.4">Section 3.4</a> of <a href="#RFC5322" id="rfc.xref.RFC5322.3"><cite title="Internet Message Format">[RFC5322]</cite></a>: 2928 3004 </p> 2929 3005 <div id="rfc.figure.u.47"></div><pre class="inline"><span id="rfc.iref.g.53"></span> <a href="#header.from" class="smpl">From</a> = <a href="#header.from" class="smpl">mailbox</a> 2930 3006 2931 3007 <a href="#header.from" class="smpl">mailbox</a> = <mailbox, defined in <a href="#RFC5322" id="rfc.xref.RFC5322.4"><cite title="Internet Message Format">[RFC5322]</cite></a>, <a href="http://tools.ietf.org/html/rfc5322#section-3.4">Section 3.4</a>> 2932 </pre><p id="rfc.section. 9.12.p.3">An example is:</p>3008 </pre><p id="rfc.section.10.12.p.3">An example is:</p> 2933 3009 <div id="rfc.figure.u.48"></div><pre class="text"> From: webmaster@example.org 2934 </pre><p id="rfc.section. 9.12.p.5">This header field <em class="bcp14">MAY</em> be used for logging purposes and as a means for identifying the source of invalid or unwanted requests. It <em class="bcp14">SHOULD NOT</em> be used as an insecure form of access protection. The interpretation of this field is that the request is being performed3010 </pre><p id="rfc.section.10.12.p.5">This header field <em class="bcp14">MAY</em> be used for logging purposes and as a means for identifying the source of invalid or unwanted requests. It <em class="bcp14">SHOULD NOT</em> be used as an insecure form of access protection. The interpretation of this field is that the request is being performed 2935 3011 on behalf of the person given, who accepts responsibility for the method performed. In particular, robot agents <em class="bcp14">SHOULD</em> include this header field so that the person responsible for running the robot can be contacted if problems occur on the receiving 2936 3012 end. 2937 3013 </p> 2938 <p id="rfc.section. 9.12.p.6">The Internet e-mail address in this field <em class="bcp14">MAY</em> be separate from the Internet host which issued the request. For example, when a request is passed through a proxy the original3014 <p id="rfc.section.10.12.p.6">The Internet e-mail address in this field <em class="bcp14">MAY</em> be separate from the Internet host which issued the request. For example, when a request is passed through a proxy the original 2939 3015 issuer's address <em class="bcp14">SHOULD</em> be used. 2940 3016 </p> 2941 <p id="rfc.section. 9.12.p.7">The client <em class="bcp14">SHOULD NOT</em> send the From header field without the user's approval, as it might conflict with the user's privacy interests or their site's3017 <p id="rfc.section.10.12.p.7">The client <em class="bcp14">SHOULD NOT</em> send the From header field without the user's approval, as it might conflict with the user's privacy interests or their site's 2942 3018 security policy. It is strongly recommended that the user be able to disable, enable, and modify the value of this field at 2943 3019 any time prior to a request. … … 2945 3021 <div id="rfc.iref.l.1"></div> 2946 3022 <div id="rfc.iref.h.14"></div> 2947 <h2 id="rfc.section. 9.13"><a href="#rfc.section.9.13">9.13</a> <a id="header.location" href="#header.location">Location</a></h2>2948 <p id="rfc.section. 9.13.p.1">The "Location" header field <em class="bcp14">MAY</em> be sent in responses to refer to a specific resource in accordance with the semantics of the status code.3023 <h2 id="rfc.section.10.13"><a href="#rfc.section.10.13">10.13</a> <a id="header.location" href="#header.location">Location</a></h2> 3024 <p id="rfc.section.10.13.p.1">The "Location" header field <em class="bcp14">MAY</em> be sent in responses to refer to a specific resource in accordance with the semantics of the status code. 2949 3025 </p> 2950 3026 <div id="rfc.figure.u.49"></div><pre class="inline"><span id="rfc.iref.g.54"></span> <a href="#header.location" class="smpl">Location</a> = <a href="#imported.abnf" class="smpl">URI-reference</a> 2951 </pre><p id="rfc.section. 9.13.p.3">For <a href="#status.201" class="smpl">201 (Created)</a> responses, the Location is the URI of the new resource which was created by the request. For <a href="#status.3xx" class="smpl">3xx (Redirection)</a> responses, the location <em class="bcp14">SHOULD</em> indicate the server's preferred URI for automatic redirection to the resource.2952 </p> 2953 <p id="rfc.section. 9.13.p.4">The field value consists of a single URI-reference. When it has the form of a relative reference (<a href="#RFC3986" id="rfc.xref.RFC3986.1"><cite title="Uniform Resource Identifier (URI): Generic Syntax">[RFC3986]</cite></a>, <a href="http://tools.ietf.org/html/rfc3986#section-4.2">Section 4.2</a>), the final value is computed by resolving it against the effective request URI (<a href="#RFC3986" id="rfc.xref.RFC3986.2"><cite title="Uniform Resource Identifier (URI): Generic Syntax">[RFC3986]</cite></a>, <a href="http://tools.ietf.org/html/rfc3986#section-5">Section 5</a>). If the original URI, as navigated to by the user agent, did contain a fragment identifier, and the final value does not,3027 </pre><p id="rfc.section.10.13.p.3">For <a href="#status.201" class="smpl">201 (Created)</a> responses, the Location is the URI of the new resource which was created by the request. For <a href="#status.3xx" class="smpl">3xx (Redirection)</a> responses, the location <em class="bcp14">SHOULD</em> indicate the server's preferred URI for automatic redirection to the resource. 3028 </p> 3029 <p id="rfc.section.10.13.p.4">The field value consists of a single URI-reference. When it has the form of a relative reference (<a href="#RFC3986" id="rfc.xref.RFC3986.1"><cite title="Uniform Resource Identifier (URI): Generic Syntax">[RFC3986]</cite></a>, <a href="http://tools.ietf.org/html/rfc3986#section-4.2">Section 4.2</a>), the final value is computed by resolving it against the effective request URI (<a href="#RFC3986" id="rfc.xref.RFC3986.2"><cite title="Uniform Resource Identifier (URI): Generic Syntax">[RFC3986]</cite></a>, <a href="http://tools.ietf.org/html/rfc3986#section-5">Section 5</a>). If the original URI, as navigated to by the user agent, did contain a fragment identifier, and the final value does not, 2954 3030 then the original URI's fragment identifier is added to the final value. 2955 3031 </p> … … 2960 3036 <p>An original URI "http://www.example.org/index.html#larry", combined with a field value given as:</p> <pre class="text"> Location: http://www.example.net/index.html 2961 3037 </pre> <p>would result in a final value of "http://www.example.net/index.html#larry", preserving the original fragment identifier.</p> 2962 <div class="note" id="rfc.section. 9.13.p.7">3038 <div class="note" id="rfc.section.10.13.p.7"> 2963 3039 <p> <b>Note:</b> Some recipients attempt to recover from Location fields that are not valid URI references. This specification does not mandate 2964 3040 or define such processing, but does allow it. 2965 3041 </p> 2966 3042 </div> 2967 <p id="rfc.section. 9.13.p.8">There are circumstances in which a fragment identifier in a Location URI would not be appropriate. For instance, when it appears3043 <p id="rfc.section.10.13.p.8">There are circumstances in which a fragment identifier in a Location URI would not be appropriate. For instance, when it appears 2968 3044 in a <a href="#status.201" class="smpl">201 2969 3045 (Created)</a> response, where the Location header field specifies the URI for the entire created resource. 2970 3046 </p> 2971 <div class="note" id="rfc.section. 9.13.p.9">2972 <p> <b>Note:</b> The <a href="#header.content-location" class="smpl">Content-Location</a> header field (<a href="#header.content-location" id="rfc.xref.header.content-location.3" title="Content-Location">Section 9.8</a>) differs from Location in that the Content-Location identifies the most specific resource corresponding to the enclosed representation.3047 <div class="note" id="rfc.section.10.13.p.9"> 3048 <p> <b>Note:</b> The <a href="#header.content-location" class="smpl">Content-Location</a> header field (<a href="#header.content-location" id="rfc.xref.header.content-location.3" title="Content-Location">Section 10.8</a>) differs from Location in that the Content-Location identifies the most specific resource corresponding to the enclosed representation. 2973 3049 It is therefore possible for a response to contain header fields for both Location and Content-Location. 2974 3050 </p> … … 2976 3052 <div id="rfc.iref.m.9"></div> 2977 3053 <div id="rfc.iref.h.15"></div> 2978 <h2 id="rfc.section. 9.14"><a href="#rfc.section.9.14">9.14</a> <a id="header.max-forwards" href="#header.max-forwards">Max-Forwards</a></h2>2979 <p id="rfc.section. 9.14.p.1">The "Max-Forwards" header field provides a mechanism with the TRACE (<a href="#TRACE" id="rfc.xref.TRACE.1" title="TRACE">Section 2.3.7</a>) and OPTIONS (<a href="#OPTIONS" id="rfc.xref.OPTIONS.1" title="OPTIONS">Section 2.3.1</a>) methods to limit the number of times that the request is forwarded by proxies. This can be useful when the client is attempting3054 <h2 id="rfc.section.10.14"><a href="#rfc.section.10.14">10.14</a> <a id="header.max-forwards" href="#header.max-forwards">Max-Forwards</a></h2> 3055 <p id="rfc.section.10.14.p.1">The "Max-Forwards" header field provides a mechanism with the TRACE (<a href="#TRACE" id="rfc.xref.TRACE.2" title="TRACE">Section 3.3.7</a>) and OPTIONS (<a href="#OPTIONS" id="rfc.xref.OPTIONS.2" title="OPTIONS">Section 3.3.1</a>) methods to limit the number of times that the request is forwarded by proxies. This can be useful when the client is attempting 2980 3056 to trace a request which appears to be failing or looping mid-chain. 2981 3057 </p> 2982 3058 <div id="rfc.figure.u.52"></div><pre class="inline"><span id="rfc.iref.g.55"></span> <a href="#header.max-forwards" class="smpl">Max-Forwards</a> = 1*<a href="#imported.abnf" class="smpl">DIGIT</a> 2983 </pre><p id="rfc.section. 9.14.p.3">The Max-Forwards value is a decimal integer indicating the remaining number of times this request message can be forwarded.</p>2984 <p id="rfc.section. 9.14.p.4">Each recipient of a TRACE or OPTIONS request containing a Max-Forwards header field <em class="bcp14">MUST</em> check and update its value prior to forwarding the request. If the received value is zero (0), the recipient <em class="bcp14">MUST NOT</em> forward the request; instead, it <em class="bcp14">MUST</em> respond as the final recipient. If the received Max-Forwards value is greater than zero, then the forwarded message <em class="bcp14">MUST</em> contain an updated Max-Forwards field with a value decremented by one (1).2985 </p> 2986 <p id="rfc.section. 9.14.p.5">The Max-Forwards header field <em class="bcp14">MAY</em> be ignored for all other request methods.3059 </pre><p id="rfc.section.10.14.p.3">The Max-Forwards value is a decimal integer indicating the remaining number of times this request message can be forwarded.</p> 3060 <p id="rfc.section.10.14.p.4">Each recipient of a TRACE or OPTIONS request containing a Max-Forwards header field <em class="bcp14">MUST</em> check and update its value prior to forwarding the request. If the received value is zero (0), the recipient <em class="bcp14">MUST NOT</em> forward the request; instead, it <em class="bcp14">MUST</em> respond as the final recipient. If the received Max-Forwards value is greater than zero, then the forwarded message <em class="bcp14">MUST</em> contain an updated Max-Forwards field with a value decremented by one (1). 3061 </p> 3062 <p id="rfc.section.10.14.p.5">The Max-Forwards header field <em class="bcp14">MAY</em> be ignored for all other request methods. 2987 3063 </p> 2988 3064 <div id="rfc.iref.r.2"></div> 2989 3065 <div id="rfc.iref.h.16"></div> 2990 <h2 id="rfc.section. 9.15"><a href="#rfc.section.9.15">9.15</a> <a id="header.referer" href="#header.referer">Referer</a></h2>2991 <p id="rfc.section. 9.15.p.1">The "Referer" [sic] header field allows the client to specify the URI of the resource from which the target URI was obtained3066 <h2 id="rfc.section.10.15"><a href="#rfc.section.10.15">10.15</a> <a id="header.referer" href="#header.referer">Referer</a></h2> 3067 <p id="rfc.section.10.15.p.1">The "Referer" [sic] header field allows the client to specify the URI of the resource from which the target URI was obtained 2992 3068 (the "referrer", although the header field is misspelled.). 2993 3069 </p> 2994 <p id="rfc.section. 9.15.p.2">The Referer header field allows servers to generate lists of back-links to resources for interest, logging, optimized caching,3070 <p id="rfc.section.10.15.p.2">The Referer header field allows servers to generate lists of back-links to resources for interest, logging, optimized caching, 2995 3071 etc. It also allows obsolete or mistyped links to be traced for maintenance. Some servers use Referer as a means of controlling 2996 3072 where they allow links from (so-called "deep linking"), but legitimate requests do not always contain a Referer header field. 2997 3073 </p>