Changeset 2094 for draft-ietf-httpbis/latest
- Timestamp:
- 07/01/13 07:07:55 (10 years ago)
- Location:
- draft-ietf-httpbis/latest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
draft-ietf-httpbis/latest/p2-semantics.html
r2092 r2094 1414 1414 <div id="rfc.iref.p.2"></div> 1415 1415 <h3 id="rfc.section.4.3.3"><a href="#rfc.section.4.3.3">4.3.3</a> <a id="POST" href="#POST">POST</a></h3> 1416 <p id="rfc.section.4.3.3.p.1">The POST method requests that the origin server accept the representation enclosed in the request as data to be processed1417 by the <a href="#resources" class="smpl">target resource</a>. For example, POST is frequentlyused for the following functions (among others):1416 <p id="rfc.section.4.3.3.p.1">The POST method requests that the <a href="#resources" class="smpl">target resource</a> process the representation enclosed in the request according to the resource's own specific semantics. For example, POST is 1417 used for the following functions (among others): 1418 1418 </p> 1419 1419 <ul> 1420 <li> Annotation of existing resources;</li>1421 <li>Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles;</li>1422 <li> Providing a block of data, such as the result of submitting a form, to a data-handling process;</li>1423 <li> Extending a database through an append operation.</li>1420 <li>Providing a block of data, such as the fields entered into an HTML form, to a data-handling process;</li> 1421 <li>Posting a message to a bulletin board, newsgroup, mailing list, blog, or similar group of articles;</li> 1422 <li>Creating a new resource that has yet to be identified by the origin server; and</li> 1423 <li>Appending data to a resource's existing representation(s).</li> 1424 1424 </ul> 1425 <p id="rfc.section.4.3.3.p.2">The actual function performed by the POST method is determined by the origin server and is usually dependent on the effective 1426 request URI. 1427 </p> 1428 <p id="rfc.section.4.3.3.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 1429 the result. 1430 </p> 1431 <p id="rfc.section.4.3.3.p.4">If one or more resources has been created on the origin server, the origin server <em class="bcp14">SHOULD</em> send a <a href="#status.201" class="smpl">201 (Created)</a> response containing a <a href="#header.location" class="smpl">Location</a> header field that provides an identifier for the primary resource created (<a href="#header.location" id="rfc.xref.header.location.1" title="Location">Section 7.1.2</a>) and a representation that describes the status of the request and refers to the new resource(s). 1432 </p> 1433 <p id="rfc.section.4.3.3.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.5"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Caching">[Part6]</cite></a>). A cache <em class="bcp14">MUST NOT</em> use a cached POST response to satisfy a subsequent GET or HEAD request unless the response contains a <a href="#header.content-location" class="smpl">Content-Location</a> header field with the same value as the POST's effective request URI (<a href="#header.content-location" id="rfc.xref.header.content-location.2" title="Content-Location">Section 3.1.4.2</a>). 1434 </p> 1435 <p id="rfc.section.4.3.3.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. 1425 <p id="rfc.section.4.3.3.p.2">An origin server indicates response semantics by choosing an appropriate status code depending on the result of processing 1426 the POST request; almost all of the status codes defined by this specification might be received in a response to POST (the 1427 exceptions being 206, 304, and 416). 1428 </p> 1429 <p id="rfc.section.4.3.3.p.3">If one or more resources has been created on the origin server as a result of successfully processing a POST request, the 1430 origin server <em class="bcp14">SHOULD</em> send a <a href="#status.201" class="smpl">201 (Created)</a> response containing a <a href="#header.location" class="smpl">Location</a> header field that provides an identifier for the primary resource created (<a href="#header.location" id="rfc.xref.header.location.1" title="Location">Section 7.1.2</a>) and a representation that describes the status of the request while referring to the new resource(s). 1431 </p> 1432 <p id="rfc.section.4.3.3.p.4">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.5"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Caching">[Part6]</cite></a>). However, POST caching is not widely implemented. For cases where an origin server wishes the client to be able to cache 1433 the result of a POST in a way that can be reused by a later GET, the origin server <em class="bcp14">MAY</em> send a <a href="#status.200" class="smpl">200 (OK)</a> response containing the result and a <a href="#header.content-location" class="smpl">Content-Location</a> header field that has the same value as the POST's effective request URI (<a href="#header.content-location" id="rfc.xref.header.content-location.2" title="Content-Location">Section 3.1.4.2</a>). 1434 </p> 1435 <p id="rfc.section.4.3.3.p.5">If the result of processing a POST would be equivalent to a representation of an existing resource, an origin server <em class="bcp14">MAY</em> redirect the user agent to that resource by sending a <a href="#status.303" class="smpl">303 (See Other)</a> response with the existing resource's identifier in the <a href="#header.location" class="smpl">Location</a> field. This has the benefits of providing the user agent a resource identifier and transferring the representation via a method 1436 more amenable to shared caching, though at the cost of an extra request if the user agent does not already have the representation 1437 cached. 1436 1438 </p> 1437 1439 <h3 id="rfc.section.4.3.4"><a href="#rfc.section.4.3.4">4.3.4</a> <a id="PUT" href="#PUT">PUT</a></h3> -
draft-ietf-httpbis/latest/p2-semantics.xml
r2092 r2094 1308 1308 <iref primary="true" item="POST method" x:for-anchor=""/> 1309 1309 <t> 1310 The POST method requests that the origin server accept the1311 representation enclosed in the request as data to be processed by the1312 <x:ref>target resource</x:ref>. For example, POST is frequently used for the following1313 functions(among others):1310 The POST method requests that the <x:ref>target resource</x:ref> process 1311 the representation enclosed in the request according to the resource's own 1312 specific semantics. For example, POST is used for the following functions 1313 (among others): 1314 1314 <list style="symbols"> 1315 <t> 1316 Annotation of existing resources; 1317 </t> 1318 <t> 1319 Posting a message to a bulletin board, newsgroup, mailing list, 1320 or similar group of articles; 1321 </t> 1322 <t> 1323 Providing a block of data, such as the result of submitting a 1324 form, to a data-handling process; 1325 </t> 1326 <t> 1327 Extending a database through an append operation. 1328 </t> 1315 <t>Providing a block of data, such as the fields entered into an HTML 1316 form, to a data-handling process;</t> 1317 <t>Posting a message to a bulletin board, newsgroup, mailing list, blog, 1318 or similar group of articles;</t> 1319 <t>Creating a new resource that has yet to be identified by the origin 1320 server; and</t> 1321 <t>Appending data to a resource's existing representation(s).</t> 1329 1322 </list> 1330 1323 </t> 1331 1324 <t> 1332 The actual function performed by the POST method is determined by the 1333 origin server and is usually dependent on the effective request URI. 1334 </t> 1335 <t> 1336 The action performed by the POST method might not result in a resource that 1337 can be identified by a URI. In this case, either <x:ref>200 (OK)</x:ref> or 1338 <x:ref>204 (No Content)</x:ref> is the appropriate response status 1339 code, depending on whether or not the response includes a representation 1340 that describes the result. 1341 </t> 1342 <t> 1343 If one or more resources has been created on the origin server, the origin 1344 server &SHOULD; send a <x:ref>201 (Created)</x:ref> response containing a 1345 <x:ref>Location</x:ref> header field that provides an identifier for the 1346 primary resource created (<xref target="header.location"/>) and a 1347 representation that describes the status of the request and refers to the 1348 new resource(s). 1325 An origin server indicates response semantics by choosing an appropriate 1326 status code depending on the result of processing the POST request; 1327 almost all of the status codes defined by this specification might be 1328 received in a response to POST (the exceptions being 206, 304, and 416). 1329 </t> 1330 <t> 1331 If one or more resources has been created on the origin server as a result 1332 of successfully processing a POST request, the origin server &SHOULD; send 1333 a <x:ref>201 (Created)</x:ref> response containing a <x:ref>Location</x:ref> 1334 header field that provides an identifier for the primary resource created 1335 (<xref target="header.location"/>) and a representation that describes the 1336 status of the request while referring to the new resource(s). 1349 1337 </t> 1350 1338 <t> 1351 1339 Responses to POST requests are only cacheable when they include explicit 1352 freshness information (see &p6-explicit;). A cache &MUST-NOT; use a cached 1353 POST response to satisfy a subsequent GET or HEAD request unless the 1354 response contains a <x:ref>Content-Location</x:ref> header field with the 1355 same value as the POST's effective request URI (&header-content-location;). 1356 </t> 1357 <t> 1358 Note that POST caching is not widely implemented. 1359 However, the <x:ref>303 (See Other)</x:ref> response can be used to direct 1360 the user agent to retrieve a cacheable representation of the resource. 1340 freshness information (see &p6-explicit;). However, POST caching is not 1341 widely implemented. For cases where an origin server wishes the client to 1342 be able to cache the result of a POST in a way that can be reused by a 1343 later GET, the origin server &MAY; send a <x:ref>200 (OK)</x:ref> response 1344 containing the result and a <x:ref>Content-Location</x:ref> header field 1345 that has the same value as the POST's effective request URI 1346 (&header-content-location;). 1347 </t> 1348 <t> 1349 If the result of processing a POST would be equivalent to a representation 1350 of an existing resource, an origin server &MAY; redirect the user agent to 1351 that resource by sending a <x:ref>303 (See Other)</x:ref> response with the 1352 existing resource's identifier in the <x:ref>Location</x:ref> field. 1353 This has the benefits of providing the user agent a resource identifier 1354 and transferring the representation via a method more amenable to shared 1355 caching, though at the cost of an extra request if the user agent does not 1356 already have the representation cached. 1361 1357 </t> 1362 1358 </section>
Note: See TracChangeset
for help on using the changeset viewer.