Ignore:
Timestamp:
Apr 1, 2010, 6:37:58 AM (10 years ago)
Author:
julian.reschke@…
Message:

Add an example for an ETag varying based on the Accept-Encoding (related to #39)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • draft-ietf-httpbis/latest/p4-conditional.xml

    r799 r800  
    2121  <!ENTITY messaging                  "<xref target='Part1' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
    2222  <!ENTITY caching                    "<xref target='Part6' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
     23  <!ENTITY header-accept-encoding     "<xref target='Part3' x:rel='#header.accept-encoding' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
    2324  <!ENTITY header-if-range            "<xref target='Part5' x:rel='#header.if-range' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
    2425  <!ENTITY header-range               "<xref target='Part5' x:rel='#header.range' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
     
    2627  <!ENTITY clockless                  "<xref target='Part1' x:rel='#clockless.origin.server.operation' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
    2728  <!ENTITY full-date                  "<xref target='Part1' x:rel='#date.time.formats.full.date' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
     29  <!ENTITY transfer-codings           "<xref target='Part1' x:rel='#transfer.codings' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
     30  <!ENTITY content-negotiation        "<xref target='Part3' x:rel='#content.negotiation' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
    2831]>
    2932<?rfc toc="yes" ?>
     
    340343   entities.
    341344</t>
     345
     346<section title="Example: Entity Tags varying on Content-Negotiated Resources" anchor="example.entity.tag.vs.conneg">
     347<t>
     348   Consider a resource that is subject to content negotiation (&content-negotiation;),
     349   and where the representations returned upon a GET request vary based on
     350   the Accept-Encoding request header field (&header-accept-encoding;):
     351</t>
     352<figure><preamble>>> Request:</preamble><artwork type="message/http; msgtype=&#34;request&#34;"  x:indent-with="  ">
     353GET /index HTTP/1.1
     354Host: www.example.com
     355Accept-Encoding: gzip
     356
     357</artwork></figure>
     358<t>
     359   In this case, the response may use the gzip Content Coding or not.
     360   If it does, it might look like that:
     361</t>
     362<figure><preamble>>> Response:</preamble><artwork type="message/http; msgtype=&#34;response&#34;"  x:indent-with="  ">
     363HTTP/1.1 200 OK
     364Date: Thu, 26 Mar 2010 00:05:00 GMT
     365ETag: "123-a"
     366Content-Length: <x:length-of target="exbody"/>
     367Vary: Accept-Encoding
     368Content-Type: text/plain
     369
     370<x:span anchor="exbody">Hello World!
     371Hello World!
     372Hello World!
     373Hello World!
     374Hello World!
     375</x:span></artwork></figure>
     376<t>
     377   A variant that does use gzip Content Coding would be:
     378</t>
     379<figure><preamble>>> Response:</preamble><artwork type="message/http; msgtype=&#34;response&#34;"  x:indent-with="  ">
     380HTTP/1.1 200 OK
     381Date: Thu, 26 Mar 2010 00:05:00 GMT
     382ETag: "123-b"
     383Content-Length: 43
     384Vary: Accept-Encoding
     385Content-Type: text/plain
     386Content-Encoding: gzip
     387
     388<spanx>...binary data...</spanx></artwork></figure>
     389<x:note>
     390  <t>
     391    <x:h>Note:</x:h> Content Codings are a property of the response
     392    entity, thus affect the Entity Tag. An alternative are Transfer
     393    Codings (&transfer-codings;) which apply only to the transfer of
     394    the message, and thus do not require assigning distinct entity tags.
     395  </t>
     396</x:note>
     397</section>
    342398</section>
    343399
     
    12001256</reference>
    12011257
     1258<reference anchor="Part3">
     1259  <front>
     1260    <title abbrev="HTTP/1.1">HTTP/1.1, part 3: Message Payload and Content Negotiation</title>
     1261    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
     1262      <organization abbrev="Day Software">Day Software</organization>
     1263      <address><email>fielding@gbiv.com</email></address>
     1264    </author>
     1265    <author initials="J." surname="Gettys" fullname="Jim Gettys">
     1266      <organization>One Laptop per Child</organization>
     1267      <address><email>jg@laptop.org</email></address>
     1268    </author>
     1269    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
     1270      <organization abbrev="HP">Hewlett-Packard Company</organization>
     1271      <address><email>JeffMogul@acm.org</email></address>
     1272    </author>
     1273    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
     1274      <organization abbrev="Microsoft">Microsoft Corporation</organization>
     1275      <address><email>henrikn@microsoft.com</email></address>
     1276    </author>
     1277    <author initials="L." surname="Masinter" fullname="Larry Masinter">
     1278      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
     1279      <address><email>LMM@acm.org</email></address>
     1280    </author>
     1281    <author initials="P." surname="Leach" fullname="Paul J. Leach">
     1282      <organization abbrev="Microsoft">Microsoft Corporation</organization>
     1283      <address><email>paulle@microsoft.com</email></address>
     1284    </author>
     1285    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
     1286      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
     1287      <address><email>timbl@w3.org</email></address>
     1288    </author>
     1289    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
     1290      <organization abbrev="W3C">World Wide Web Consortium</organization>
     1291      <address><email>ylafon@w3.org</email></address>
     1292    </author>
     1293    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
     1294      <organization abbrev="greenbytes">greenbytes GmbH</organization>
     1295      <address><email>julian.reschke@greenbytes.de</email></address>
     1296    </author>
     1297    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
     1298  </front>
     1299  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p3-payload-&ID-VERSION;"/>
     1300  <x:source href="p3-payload.xml" basename="p3-payload"/>
     1301</reference>
     1302
    12021303<reference anchor="Part5">
    12031304  <front>
Note: See TracChangeset for help on using the changeset viewer.