Changeset 1428 for draft-ietf-httpbis
- Timestamp:
- 01/09/11 08:55:31 (11 years ago)
- Location:
- draft-ietf-httpbis/latest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
draft-ietf-httpbis/latest/p2-semantics.html
r1427 r1428 1693 1693 <h2 id="rfc.section.7.3"><a href="#rfc.section.7.3">7.3</a> <a id="status.3xx" href="#status.3xx">Redirection 3xx</a></h2> 1694 1694 <p id="rfc.section.7.3.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. 1695 The action required <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 1696 known to be "safe", as defined in <a href="#safe.methods" title="Safe Methods">Section 6.1.1</a>. A client <em class="bcp14">SHOULD</em> detect infinite redirection loops, since such loops generate network traffic for each redirection. 1697 </p> 1698 <div class="note" id="rfc.section.7.3.p.2"> 1699 <p> <b>Note:</b> An earlier version of this specification recommended a maximum of five redirections (<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">Section 10.3</a>). Content developers need to be aware that some clients might implement such a fixed limitation. 1695 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 1696 known to be "safe", as defined in <a href="#safe.methods" title="Safe Methods">Section 6.1.1</a>. 1697 </p> 1698 <p id="rfc.section.7.3.p.2">There are several types of redirects: </p> 1699 <ol> 1700 <li> 1701 <p>Redirects of the request to another URI, either temporarily or permanently. The new URI is specified in the Location header 1702 field. In this specification, the status codes 301 (Moved Permanently), 302 (Found), and 307 (Temporary Redirect) fall under 1703 this category. 1704 </p> 1705 </li> 1706 <li> 1707 <p>Redirection to a new location that represents an indirect response to the request, such as the result of a POST operation 1708 to be retrieved with a subsequent GET request. This is status code 303 (See Other). 1709 </p> 1710 </li> 1711 <li> 1712 <p>Redirection offering a choice of matching resources for use by agent-driven content negotiation (<a href="p3-payload.html#agent-driven.negotiation" title="Agent-driven Negotiation">Section 5.2</a> of <a href="#Part3" id="rfc.xref.Part3.7"><cite title="HTTP/1.1, part 3: Message Payload and Content Negotiation">[Part3]</cite></a>). This is status code 300 (Multiple Choices). 1713 </p> 1714 </li> 1715 <li> 1716 <p>Other kinds of redirection, such as to a cached result (status code 304 (Not Modified)).</p> 1717 </li> 1718 </ol> 1719 <div class="note" id="rfc.section.7.3.p.3"> 1720 <p> <b>Note:</b> In HTTP/1.0, only the status codes 301 (Moved Permanently) and 302 (Found) were defined for the first type of redirect, and 1721 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 1722 retrieval (GET). To address this use case, HTTP/1.1 introduced the second type of redirect with the status code 303 (See Other) 1723 (<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 1724 yet another status code, 307 (Temporary Redirect), 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 301 and 302, therefore this specification 1725 makes that behavior compliant in case the original request was POST. 1726 </p> 1727 </div> 1728 <p id="rfc.section.7.3.p.4">Clients <em class="bcp14">SHOULD</em> detect and intervene in cyclical redirections (i.e., "infinite" redirection loops). 1729 </p> 1730 <div class="note" id="rfc.section.7.3.p.5"> 1731 <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. 1700 1732 </p> 1701 1733 </div> … … 1704 1736 <h3 id="rfc.section.7.3.1"><a href="#rfc.section.7.3.1">7.3.1</a> <a id="status.300" href="#status.300">300 Multiple Choices</a></h3> 1705 1737 <p id="rfc.section.7.3.1.p.1">The target resource has more than one representation, each with its own specific location, and agent-driven negotiation information 1706 (<a href="p3-payload.html#content.negotiation" title="Content Negotiation">Section 5</a> of <a href="#Part3" id="rfc.xref.Part3. 7"><cite title="HTTP/1.1, part 3: Message Payload and Content Negotiation">[Part3]</cite></a>) is being provided so that the user (or user agent) can select a preferred representation by redirecting its request to that1738 (<a href="p3-payload.html#content.negotiation" title="Content Negotiation">Section 5</a> of <a href="#Part3" id="rfc.xref.Part3.8"><cite title="HTTP/1.1, part 3: Message Payload and Content Negotiation">[Part3]</cite></a>) is being provided so that the user (or user agent) can select a preferred representation by redirecting its request to that 1707 1739 location. 1708 1740 </p> … … 1729 1761 </p> 1730 1762 <div class="note" id="rfc.section.7.3.2.p.5"> 1731 <p> <b>Note:</b> When automatically redirecting a POST request after receiving a 301 status code, some existing HTTP/1.0 user agents will erroneously1732 change it into a GET request.1763 <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 307 (Temporary 1764 Redirect) can be used instead. 1733 1765 </p> 1734 1766 </div> … … 1744 1776 </p> 1745 1777 <div class="note" id="rfc.section.7.3.3.p.4"> 1746 <p> <b>Note:</b> HTTP/1.0 (<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>) and the first version of HTTP/1.1 (<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.3">Section 10.3.3</a>) specify that the client is not allowed to change the method on the redirected request. However, most existing user agent 1747 implementations treat 302 as if it were a 303 response, performing a GET on the Location field-value regardless of the original 1748 request method. Therefore, a previous version of this specification (<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.3">Section 10.3.3</a>) has added the status codes <a href="#status.303" id="rfc.xref.status.303.2">303</a> and <a href="#status.307" id="rfc.xref.status.307.2">307</a> for servers that wish to make unambiguously clear which kind of reaction is expected of the client. 1778 <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 307 (Temporary 1779 Redirect) can be used instead. <span class="comment" id="issue312">[<a href="#issue312" class="smpl">issue312</a>: but see <<a href="http://trac.tools.ietf.org/wg/httpbis/trac/ticket/312">http://trac.tools.ietf.org/wg/httpbis/trac/ticket/312</a>>]</span> 1749 1780 </p> 1750 1781 </div> … … 1845 1876 <h3 id="rfc.section.7.4.7"><a href="#rfc.section.7.4.7">7.4.7</a> <a id="status.406" href="#status.406">406 Not Acceptable</a></h3> 1846 1877 <p id="rfc.section.7.4.7.p.1">The resource identified by the request is only capable of generating response representations which have content characteristics 1847 not acceptable according to the Accept and Accept-* header fields sent in the request (see <a href="p3-payload.html#header.field.definitions" title="Header Field Definitions">Section 6</a> of <a href="#Part3" id="rfc.xref.Part3. 8"><cite title="HTTP/1.1, part 3: Message Payload and Content Negotiation">[Part3]</cite></a>).1878 not acceptable according to the Accept and Accept-* header fields sent in the request (see <a href="p3-payload.html#header.field.definitions" title="Header Field Definitions">Section 6</a> of <a href="#Part3" id="rfc.xref.Part3.9"><cite title="HTTP/1.1, part 3: Message Payload and Content Negotiation">[Part3]</cite></a>). 1848 1879 </p> 1849 1880 <p id="rfc.section.7.4.7.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 … … 2094 2125 </div> 2095 2126 <div class="note" id="rfc.section.8.4.p.9"> 2096 <p> <b>Note:</b> The Content-Location header field (<a href="p3-payload.html#header.content-location" title="Content-Location">Section 6.7</a> of <a href="#Part3" id="rfc.xref.Part3. 9"><cite title="HTTP/1.1, part 3: Message Payload and Content Negotiation">[Part3]</cite></a>) differs from Location in that the Content-Location identifies the most specific resource corresponding to the enclosed representation.2127 <p> <b>Note:</b> The Content-Location header field (<a href="p3-payload.html#header.content-location" title="Content-Location">Section 6.7</a> of <a href="#Part3" id="rfc.xref.Part3.10"><cite title="HTTP/1.1, part 3: Message Payload and Content Negotiation">[Part3]</cite></a>) differs from Location in that the Content-Location identifies the most specific resource corresponding to the enclosed representation. 2097 2128 It is therefore possible for a response to contain header fields for both Location and Content-Location. 2098 2129 </p> … … 2339 2370 <td class="left">303</td> 2340 2371 <td class="left">See Other</td> 2341 <td class="left"> <a href="#status.303" id="rfc.xref.status.303. 3" title="303 See Other">Section 7.3.4</a>2372 <td class="left"> <a href="#status.303" id="rfc.xref.status.303.2" title="303 See Other">Section 7.3.4</a> 2342 2373 </td> 2343 2374 </tr> … … 2357 2388 <td class="left">307</td> 2358 2389 <td class="left">Temporary Redirect</td> 2359 <td class="left"> <a href="#status.307" id="rfc.xref.status.307. 3" title="307 Temporary Redirect">Section 7.3.8</a>2390 <td class="left"> <a href="#status.307" id="rfc.xref.status.307.2" title="307 Temporary Redirect">Section 7.3.8</a> 2360 2391 </td> 2361 2392 </tr> … … 2769 2800 </p> 2770 2801 <p id="rfc.section.A.p.6">Failed to consider that there are many other request methods that are safe to automatically redirect, and further that the 2771 user agent is able to make that determination based on the request method semantics. (Sections <a href="#status.301" id="rfc.xref.status.301.3" title="301 Moved Permanently">7.3.2</a>, <a href="#status.302" id="rfc.xref.status.302.3" title="302 Found">7.3.3</a> and <a href="#status.307" id="rfc.xref.status.307.4" title="307 Temporary Redirect">7.3.8</a>) 2802 user agent is able to make that determination based on the request method semantics. Furthermore, allow user agents to rewrite 2803 the method from POST to GET for status codes 301 and 302. (Sections <a href="#status.301" id="rfc.xref.status.301.3" title="301 Moved Permanently">7.3.2</a>, <a href="#status.302" id="rfc.xref.status.302.3" title="302 Found">7.3.3</a> and <a href="#status.307" id="rfc.xref.status.307.3" title="307 Temporary Redirect">7.3.8</a>) 2772 2804 </p> 2773 2805 <p id="rfc.section.A.p.7">Deprecate 305 Use Proxy status code, because user agents did not implement it. It used to indicate that the target resource … … 3123 3155 <p id="rfc.section.C.18.p.1">Closed issues: </p> 3124 3156 <ul> 3157 <li> <<a href="http://tools.ietf.org/wg/httpbis/trac/ticket/160">http://tools.ietf.org/wg/httpbis/trac/ticket/160</a>>: "Redirects and non-GET methods" 3158 </li> 3125 3159 <li> <<a href="http://tools.ietf.org/wg/httpbis/trac/ticket/310">http://tools.ietf.org/wg/httpbis/trac/ticket/310</a>>: "clarify 303 redirect on HEAD" 3126 3160 </li> … … 3155 3189 <li>301 Moved Permanently (status code) <a href="#rfc.xref.status.301.1">4.1</a>, <a href="#rfc.iref.32"><b>7.3.2</b></a>, <a href="#rfc.xref.status.301.2">9.2</a>, <a href="#rfc.xref.status.301.3">A</a></li> 3156 3190 <li>302 Found (status code) <a href="#rfc.xref.status.302.1">4.1</a>, <a href="#rfc.iref.33"><b>7.3.3</b></a>, <a href="#rfc.xref.status.302.2">9.2</a>, <a href="#rfc.xref.status.302.3">A</a></li> 3157 <li>303 See Other (status code) <a href="#rfc.xref.status.303.1">4.1</a>, <a href="#rfc. xref.status.303.2">7.3.3</a>, <a href="#rfc.iref.34"><b>7.3.4</b></a>, <a href="#rfc.xref.status.303.3">9.2</a></li>3191 <li>303 See Other (status code) <a href="#rfc.xref.status.303.1">4.1</a>, <a href="#rfc.iref.34"><b>7.3.4</b></a>, <a href="#rfc.xref.status.303.2">9.2</a></li> 3158 3192 <li>304 Not Modified (status code) <a href="#rfc.iref.35"><b>7.3.5</b></a></li> 3159 3193 <li>305 Use Proxy (status code) <a href="#rfc.xref.status.305.1">4.1</a>, <a href="#rfc.iref.36"><b>7.3.6</b></a>, <a href="#rfc.xref.status.305.2">9.2</a>, <a href="#rfc.xref.status.305.3">A</a></li> 3160 3194 <li>306 (Unused) (status code) <a href="#rfc.iref.37"><b>7.3.7</b></a>, <a href="#rfc.xref.status.306.1">9.2</a></li> 3161 <li>307 Temporary Redirect (status code) <a href="#rfc.xref.status.307.1">4.1</a>, <a href="#rfc. xref.status.307.2">7.3.3</a>, <a href="#rfc.iref.38"><b>7.3.8</b></a>, <a href="#rfc.xref.status.307.3">9.2</a>, <a href="#rfc.xref.status.307.4">A</a></li>3195 <li>307 Temporary Redirect (status code) <a href="#rfc.xref.status.307.1">4.1</a>, <a href="#rfc.iref.38"><b>7.3.8</b></a>, <a href="#rfc.xref.status.307.2">9.2</a>, <a href="#rfc.xref.status.307.3">A</a></li> 3162 3196 </ul> 3163 3197 </li> … … 3309 3343 </ul> 3310 3344 </li> 3311 <li><em>Part3</em> <a href="#rfc.xref.Part3.1">3.2</a>, <a href="#rfc.xref.Part3.2">3.2</a>, <a href="#rfc.xref.Part3.3">3.2</a>, <a href="#rfc.xref.Part3.4">3.2</a>, <a href="#rfc.xref.Part3.5">5</a>, <a href="#rfc.xref.Part3.6">6.5</a>, <a href="#rfc.xref.Part3.7">7.3.1</a>, <a href="#rfc.xref.Part3.8">7.4.7</a>, <a href="#rfc.xref.Part3.9">8.4</a>, <a href="#Part3"><b>12.1</b></a><ul> 3312 <li><em>Section 5</em> <a href="#rfc.xref.Part3.7">7.3.1</a></li> 3345 <li><em>Part3</em> <a href="#rfc.xref.Part3.1">3.2</a>, <a href="#rfc.xref.Part3.2">3.2</a>, <a href="#rfc.xref.Part3.3">3.2</a>, <a href="#rfc.xref.Part3.4">3.2</a>, <a href="#rfc.xref.Part3.5">5</a>, <a href="#rfc.xref.Part3.6">6.5</a>, <a href="#rfc.xref.Part3.7">7.3</a>, <a href="#rfc.xref.Part3.8">7.3.1</a>, <a href="#rfc.xref.Part3.9">7.4.7</a>, <a href="#rfc.xref.Part3.10">8.4</a>, <a href="#Part3"><b>12.1</b></a><ul> 3346 <li><em>Section 5</em> <a href="#rfc.xref.Part3.8">7.3.1</a></li> 3347 <li><em>Section 5.2</em> <a href="#rfc.xref.Part3.7">7.3</a></li> 3313 3348 <li><em>Section 6.1</em> <a href="#rfc.xref.Part3.1">3.2</a></li> 3314 <li><em>Section 6</em> <a href="#rfc.xref.Part3. 8">7.4.7</a></li>3349 <li><em>Section 6</em> <a href="#rfc.xref.Part3.9">7.4.7</a></li> 3315 3350 <li><em>Section 6.2</em> <a href="#rfc.xref.Part3.2">3.2</a></li> 3316 3351 <li><em>Section 6.3</em> <a href="#rfc.xref.Part3.3">3.2</a></li> 3317 3352 <li><em>Section 6.4</em> <a href="#rfc.xref.Part3.4">3.2</a></li> 3318 <li><em>Section 6.7</em> <a href="#rfc.xref.Part3.6">6.5</a>, <a href="#rfc.xref.Part3. 9">8.4</a></li>3353 <li><em>Section 6.7</em> <a href="#rfc.xref.Part3.6">6.5</a>, <a href="#rfc.xref.Part3.10">8.4</a></li> 3319 3354 </ul> 3320 3355 </li> … … 3366 3401 <li>Referer header field <a href="#rfc.xref.header.referer.1">3.2</a>, <a href="#rfc.iref.r.1"><b>8.6</b></a>, <a href="#rfc.xref.header.referer.2">9.3</a>, <a href="#rfc.xref.header.referer.3">A</a></li> 3367 3402 <li>Retry-After header field <a href="#rfc.xref.header.retry-after.1">3.3</a>, <a href="#rfc.xref.header.retry-after.2">7.5.4</a>, <a href="#rfc.iref.r.2"><b>8.7</b></a>, <a href="#rfc.xref.header.retry-after.3">9.3</a></li> 3368 <li><em>RFC1945</em> <a href="#rfc.xref.RFC1945.1">7.3 .3</a>, <a href="#RFC1945"><b>12.2</b></a><ul>3369 <li><em>Section 9.3</em> <a href="#rfc.xref.RFC1945.1">7.3 .3</a></li>3403 <li><em>RFC1945</em> <a href="#rfc.xref.RFC1945.1">7.3</a>, <a href="#RFC1945"><b>12.2</b></a><ul> 3404 <li><em>Section 9.3</em> <a href="#rfc.xref.RFC1945.1">7.3</a></li> 3370 3405 </ul> 3371 3406 </li> 3372 <li><em>RFC2068</em> <a href="#rfc.xref.RFC2068.1">7.3</a>, <a href="#rfc.xref.RFC2068.2">7.3 .3</a>, <a href="#RFC2068"><b>12.2</b></a><ul>3373 <li><em>Section 10.3</em> <a href="#rfc.xref.RFC2068. 1">7.3</a></li>3374 <li><em>Section 10.3. 3</em> <a href="#rfc.xref.RFC2068.2">7.3.3</a></li>3407 <li><em>RFC2068</em> <a href="#rfc.xref.RFC2068.1">7.3</a>, <a href="#rfc.xref.RFC2068.2">7.3</a>, <a href="#RFC2068"><b>12.2</b></a><ul> 3408 <li><em>Section 10.3</em> <a href="#rfc.xref.RFC2068.2">7.3</a></li> 3409 <li><em>Section 10.3.4</em> <a href="#rfc.xref.RFC2068.1">7.3</a></li> 3375 3410 </ul> 3376 3411 </li> 3377 3412 <li><em>RFC2119</em> <a href="#rfc.xref.RFC2119.1">1.1</a>, <a href="#RFC2119"><b>12.1</b></a></li> 3378 <li><em>RFC2616</em> <a href="#rfc.xref.RFC2616.1">1</a>, <a href="#rfc.xref.RFC2616.2">7.3 .3</a>, <a href="#RFC2616"><b>12.2</b></a>, <a href="#rfc.xref.RFC2616.3">C.1</a><ul>3379 <li><em>Section 10.3. 3</em> <a href="#rfc.xref.RFC2616.2">7.3.3</a></li>3413 <li><em>RFC2616</em> <a href="#rfc.xref.RFC2616.1">1</a>, <a href="#rfc.xref.RFC2616.2">7.3</a>, <a href="#RFC2616"><b>12.2</b></a>, <a href="#rfc.xref.RFC2616.3">C.1</a><ul> 3414 <li><em>Section 10.3.8</em> <a href="#rfc.xref.RFC2616.2">7.3</a></li> 3380 3415 </ul> 3381 3416 </li> … … 3426 3461 <li>301 Moved Permanently <a href="#rfc.xref.status.301.1">4.1</a>, <a href="#rfc.iref.s.12"><b>7.3.2</b></a>, <a href="#rfc.xref.status.301.2">9.2</a>, <a href="#rfc.xref.status.301.3">A</a></li> 3427 3462 <li>302 Found <a href="#rfc.xref.status.302.1">4.1</a>, <a href="#rfc.iref.s.13"><b>7.3.3</b></a>, <a href="#rfc.xref.status.302.2">9.2</a>, <a href="#rfc.xref.status.302.3">A</a></li> 3428 <li>303 See Other <a href="#rfc.xref.status.303.1">4.1</a>, <a href="#rfc. xref.status.303.2">7.3.3</a>, <a href="#rfc.iref.s.14"><b>7.3.4</b></a>, <a href="#rfc.xref.status.303.3">9.2</a></li>3463 <li>303 See Other <a href="#rfc.xref.status.303.1">4.1</a>, <a href="#rfc.iref.s.14"><b>7.3.4</b></a>, <a href="#rfc.xref.status.303.2">9.2</a></li> 3429 3464 <li>304 Not Modified <a href="#rfc.iref.s.15"><b>7.3.5</b></a></li> 3430 3465 <li>305 Use Proxy <a href="#rfc.xref.status.305.1">4.1</a>, <a href="#rfc.iref.s.16"><b>7.3.6</b></a>, <a href="#rfc.xref.status.305.2">9.2</a>, <a href="#rfc.xref.status.305.3">A</a></li> 3431 3466 <li>306 (Unused) <a href="#rfc.iref.s.17"><b>7.3.7</b></a>, <a href="#rfc.xref.status.306.1">9.2</a></li> 3432 <li>307 Temporary Redirect <a href="#rfc.xref.status.307.1">4.1</a>, <a href="#rfc. xref.status.307.2">7.3.3</a>, <a href="#rfc.iref.s.18"><b>7.3.8</b></a>, <a href="#rfc.xref.status.307.3">9.2</a>, <a href="#rfc.xref.status.307.4">A</a></li>3467 <li>307 Temporary Redirect <a href="#rfc.xref.status.307.1">4.1</a>, <a href="#rfc.iref.s.18"><b>7.3.8</b></a>, <a href="#rfc.xref.status.307.2">9.2</a>, <a href="#rfc.xref.status.307.3">A</a></li> 3433 3468 <li>400 Bad Request <a href="#rfc.xref.status.400.1">4.1</a>, <a href="#rfc.iref.s.19"><b>7.4.1</b></a>, <a href="#rfc.xref.status.400.2">9.2</a></li> 3434 3469 <li>401 Unauthorized <a href="#rfc.iref.s.20"><b>7.4.2</b></a></li> -
draft-ietf-httpbis/latest/p2-semantics.xml
r1427 r1428 25 25 <!ENTITY auth "<xref target='Part7' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 26 26 <!ENTITY content-negotiation "<xref target='Part3' x:rel='#content.negotiation' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 27 <!ENTITY agent-driven-negotiation "<xref target='Part3' x:rel='#agent-driven.negotiation' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 27 28 <!ENTITY notation-abnf "<xref target='Part1' x:rel='#notation.abnf' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 28 29 <!ENTITY basic-rules "<xref target='Part1' x:rel='#basic.rules' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> … … 1567 1568 <t> 1568 1569 This class of status code indicates that further action needs to be 1569 taken by the user agent in order to fulfill the request. The action 1570 required &MAY; be carried out by the user agent without interaction 1571 with the user if and only if the method used in the second request is 1572 known to be "safe", as defined in <xref target="safe.methods"/>. 1573 A client &SHOULD; detect infinite redirection loops, since such loops 1574 generate network traffic for each redirection. 1570 taken by the user agent in order to fulfill the request. If the required 1571 action involves a subsequent HTTP request, it &MAY; be carried out by the 1572 user agent without interaction with the user if and only if the method used 1573 in the second request is known to be "safe", as defined in 1574 <xref target="safe.methods"/>. 1575 </t> 1576 <t> 1577 There are several types of redirects: 1578 <list style="numbers"> 1579 <x:lt> 1580 <t> 1581 Redirects of the request to another URI, either temporarily or 1582 permanently. The new URI is specified in the Location header field. 1583 In this specification, the status codes 301 (Moved Permanently), 1584 302 (Found), and 307 (Temporary Redirect) fall under this category. 1585 </t> 1586 </x:lt> 1587 <x:lt> 1588 <t> 1589 Redirection to a new location that represents an indirect response to 1590 the request, such as the result of a POST operation to be retrieved 1591 with a subsequent GET request. This is status code 303 (See Other). 1592 </t> 1593 </x:lt> 1594 <x:lt> 1595 <t> 1596 Redirection offering a choice of matching resources for use by 1597 agent-driven content negotiation (&agent-driven-negotiation;). This 1598 is status code 300 (Multiple Choices). 1599 </t> 1600 </x:lt> 1601 <x:lt> 1602 <t> 1603 Other kinds of redirection, such as to a cached result (status code 304 1604 (Not Modified)). 1605 </t> 1606 </x:lt> 1607 </list> 1608 </t> 1609 <x:note> 1610 <t> 1611 <x:h>Note:</x:h> In HTTP/1.0, only the status codes 301 (Moved Permanently) 1612 and 302 (Found) were defined for the first type of redirect, and the second 1613 type did not exist at all (<xref target="RFC1945" x:fmt="," x:sec="9.3"/>). 1614 However it turned out that web forms using POST expected redirects to change 1615 the operation for the subsequent request to retrieval (GET). To address this 1616 use case, HTTP/1.1 introduced the second type of redirect with the status 1617 code 303 (See Other) (<xref target="RFC2068" x:fmt="," x:sec="10.3.4"/>). 1618 As user agents did not change their behavior to maintain backwards 1619 compatibility, the first revision of HTTP/1.1 added yet another status code, 1620 307 (Temporary Redirect), for which the backwards compatibility problems did 1621 not apply (<xref target="RFC2616" x:fmt="," x:sec="10.3.8"/>). 1622 Over 10 years later, most user agents still do method rewriting for 1623 status codes 301 and 302, therefore this specification makes that behavior 1624 compliant in case the original request was POST. 1625 </t> 1626 </x:note> 1627 <t> 1628 Clients &SHOULD; detect and intervene in cyclical redirections (i.e., 1629 "infinite" redirection loops). 1575 1630 </t> 1576 1631 <x:note> … … 1646 1701 <x:note> 1647 1702 <t> 1648 <x:h>Note:</x:h> When automatically redirecting a POST request after 1649 receiving a 301 status code, some existing HTTP/1.0 user agents 1650 will erroneously change it into a GET request. 1703 <x:h>Note:</x:h> For historic reasons, user agents &MAY; change the 1704 request method from POST to GET for the subsequent request. If this 1705 behavior is undesired, status code 307 (Temporary Redirect) can be used 1706 instead. 1651 1707 </t> 1652 1708 </x:note> … … 1677 1733 <x:note> 1678 1734 <t> 1679 <x:h>Note:</x:h> HTTP/1.0 (<xref target="RFC1945" x:fmt="," x:sec="9.3"/>) 1680 and the first version of HTTP/1.1 (<xref target="RFC2068" x:fmt="," x:sec ="10.3.3"/>) 1681 specify that the client is not allowed to change the method on the 1682 redirected request. However, most existing user agent implementations 1683 treat 302 as if it were a 303 response, performing a GET on the Location 1684 field-value regardless of the original request method. Therefore, a 1685 previous version of this specification 1686 (<xref target="RFC2616" x:fmt="," x:sec="10.3.3"/>) has added the 1687 status codes 1688 <xref target="status.303" format="none">303</xref> and 1689 <xref target="status.307" format="none">307</xref> for servers that wish 1690 to make unambiguously clear which kind of reaction is expected of the 1691 client. 1735 <x:h>Note:</x:h> For historic reasons, user agents &MAY; change the 1736 request method from POST to GET for the subsequent request. If this 1737 behavior is undesired, status code 307 (Temporary Redirect) can be used 1738 instead. 1739 <cref anchor="issue312">but see <eref target="http://trac.tools.ietf.org/wg/httpbis/trac/ticket/312"/></cref> 1692 1740 </t> 1693 1741 </x:note> … … 3617 3665 </t> 3618 3666 <t> 3619 Failed to consider that there are 3620 many other request methods that are safe to automatically redirect, 3621 and further that the user agent is able to make that determination 3622 based on the request method semantics. 3667 Failed to consider that there are many other request methods that are safe 3668 to automatically redirect, and further that the user agent is able to make 3669 that determination based on the request method semantics. 3670 Furthermore, allow user agents to rewrite the method from POST to GET 3671 for status codes 301 and 302. 3623 3672 (Sections <xref format="counter" target="status.301"/>, 3624 3673 <xref format="counter" target="status.302"/> and … … 4272 4321 <list style="symbols"> 4273 4322 <t> 4323 <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/160"/>: 4324 "Redirects and non-GET methods" 4325 </t> 4326 <t> 4274 4327 <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/310"/>: 4275 4328 "clarify 303 redirect on HEAD"
Note: See TracChangeset
for help on using the changeset viewer.