<?xml version="1.0" encoding="UTF-8"?>
<!--
    This XML document is the output of clean-for-DTD.xslt; a tool that strips
    extensions to RFC2629(bis) from documents for processing with xml2rfc.
-->
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc subcompact="no"?>
<?rfc rfcedstyle="yes"?>
<!DOCTYPE rfc
  PUBLIC "" "rfc2629.dtd">
<rfc ipr="trust200902" docName="draft-ietf-httpbis-cice-02" category="std">

  

	<front>
  <title abbrev="HTTP CICE">Hypertext Transfer Protocol (HTTP) Client-Initiated Content-Encoding</title>
  <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke">
    <organization abbrev="greenbytes">greenbytes GmbH</organization>
    <address>
      <postal>
        <street>Hafenweg 16</street>
        <city>Muenster</city><region>NW</region><code>48155</code>
        <country>Germany</country>
      </postal>
      <email>julian.reschke@greenbytes.de</email>	
      <uri>http://greenbytes.de/tech/webdav/</uri>	
    </address>
  </author>

  <date year="2015" month="August" day="13"/>
  
  <area>Applications</area>
  <workgroup>HTTP Working Group</workgroup>
  <keyword>HTTP</keyword>
  <keyword>content-encoding</keyword>

  <abstract>
    <t>
      In HTTP, content codings allow for payload encodings such as for
      compression or integrity checks. In particular, the "gzip" content
      coding is widely used for payload data sent in response messages.
    </t>
    <t>
      Content codings can be used in request messages as well, however
      discoverability is not on par with response messages. This document
      extends the HTTP "Accept-Encoding" header field for use in responses,
      to indicate the content codings that are supported in requests.
    </t>
  </abstract>
  

  <note title="Editorial Note (To be removed by RFC Editor before publication)">
    <t>
      Discussion of this draft takes place on the HTTPBIS working group mailing list
      (ietf-http-wg@w3.org), which is archived at <eref target="https://lists.w3.org/Archives/Public/ietf-http-wg/"/>.
    </t>
    <t>
      Working Group information can be found at <eref target="https://tools.ietf.org/wg/httpbis/"/>
      and <eref target="http://httpwg.github.io/"/>; source code and issues
      list for this draft can be found at
      <eref target="https://github.com/httpwg/http-extensions"/>.
    </t>
    <t>
      The changes in this draft are summarized in <xref target="changes.since.01"/>.
    </t>
  </note>


  </front>

  <middle>

<section anchor="introduction" title="Introduction">
    <t>
      In HTTP, content codings allow for payload encodings such as for
      compression or integrity checks (<xref target="RFC7231"/>, Section 3.1.2).
      In particular, the "gzip" content coding is widely used for payload data sent in response
      messages.
    </t>
    <t>
      Content codings can be used in request messages as well, however
      discoverability is not on par with response messages. This document
      extends the HTTP "Accept-Encoding" header field (<xref target="RFC7231"/>, Section 5.3.4) for use in responses,
      to indicate the content codings that are supported in requests. It
      furthermore updates the definition of status code 415
      (Unsupported Media Type) (<xref target="RFC7231"/>, Section 6.5.13),
      recommending to include the "Accept-Encoding" header field when
      appropriate.
    </t>
</section>  

<section anchor="notational.conventions" title="Notational Conventions">
<t>
   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in <xref target="RFC2119"/>.
</t>
<t>
   This document reuses terminology defined in the base HTTP specifications,
   namely Section 2 of <xref target="RFC7230"/> and
   Section 3.1.2 of <xref target="RFC7231"/>.
</t>
</section>

<section anchor="accept-encoding" title="Using the 'Accept-Encoding' Header Field in Responses">
<t>
  Section 5.3.4 of <xref target="RFC7231"/> defines
  "Accept-Encoding" as a request header field only.
</t>
<t>
  This specification expands that definition to allow "Accept-Encoding"
  as a response header field as well.  When present in a response, it indicates what
  content codings the resource was willing to accept in the associated request.
  A field value that only contains "identity" implies that no 
  content codings were supported.
</t>
<t>
  Note that this information is specific to the associated request; the
  set of supported encodings might be different for other resources on the 
  same server, and could change over time or depend on other aspects of the 
  request (such as the request method).
</t>
<t>
  Section 6.5.13 of <xref target="RFC7231"/> defines status code
  415 (Unsupported Media Type) to apply to both media type and content coding
  related problems.
</t>
<t>
  Servers that fail a request due to an unsupported content coding SHOULD
  respond with a 415 status and SHOULD include an "Accept-Encoding" header field in
  that response, allowing clients to distinguish between content coding
  related issues and media type related issues. In order
  to avoid confusion with media type related problems, servers that fail a request
  with a 415 status for reasons unrelated to content codings SHOULD NOT
  include the "Accept-Encoding" header field.
</t>
<t>
  It is expected that the most common use of "Accept-Encoding" in responses will have the 415
  (Unsupported Media Type) status code, in response to optimistic use of a content coding by
  clients. However, the header field can also be used to indicate to clients that content codings
  are supported, to optimize future interactions. For example, a resource might include it in a 2xx
  response when the request payload was big enough to justify use of a compression coding, but the
  client failed do so.
</t>
</section>

<section anchor="example" title="Example">
<t>
  A client submits a POST request using the "compress" content coding
  (<xref target="RFC7231"/>, Section 3.1.2.1):
</t>
<figure><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
  POST /edit/ HTTP/1.1
  Host: example.org
  Content-Type: application/atom+xml;type=entry
  Content-Encoding: compress
  
  ...compressed payload...
  ]]></artwork></figure>
<t>
  The server rejects request because it only allows the "gzip" content coding:
</t>
<figure><artwork type="message/http; msgtype=&#34;response&#34;"><![CDATA[
  HTTP/1.1 415 Unsupported Media Type
  Date: Fri, 09 May 2014 11:43:53 GMT
  Accept-Encoding: gzip
  Content-Length: 68
  Content-Type: text/plain
  
  This resource only supports the "gzip" content coding in requests.
  ]]></artwork></figure>
<t>
  ...at which point the client can retry the request with the supported
  "gzip" content coding.
</t>
<t>
  Alternatively, a server that does not support any content codings in
  requests could answer with:
</t>
<figure><artwork type="message/http; msgtype=&#34;response&#34;"><![CDATA[
  HTTP/1.1 415 Unsupported Media Type
  Date: Fri, 09 May 2014 11:43:53 GMT
  Accept-Encoding: identity
  Content-Length: 61
  Content-Type: text/plain
  
  This resource does not support content codings in requests.
  ]]></artwork></figure>
</section>

<section anchor="deployment.considerations" title="Deployment Considerations">
<t>
  Servers that do not support content codings in requests already are required
  to fail a request that uses a content coding. Section 6.5.13 of <xref target="RFC7231"/>
  defines the status code 415 (Unsupported Media Type) for this purpose, so the only
  change needed is to include the "Accept-Encoding" header field with value
  "identity" in that response.
</t>
<t>
  Servers that do support some content codings are required to fail requests
  with unsupported content codings as well. To be compliant with this specification,
  servers will need to use the status code 415 (Unsupported Media Type) to
  signal the problem, and will have to include an "Accept-Encoding" header field
  that enumerates the content codings that are supported. As the set of
  supported content codings is usually
  static and small, adding the header field ought to be trivial.
</t>
</section>

<section anchor="security.considerations" title="Security Considerations">
<t>
  This specification does not introduce any new security considerations
  beyond those discussed in Section 9 of <xref target="RFC7231"/>.
</t>
</section>

<section anchor="iana.considerations" title="IANA Considerations">
<section title="Header Field Registry">
<t>
   HTTP header fields are registered within the "Message Headers" registry
   located at <eref target="http://www.iana.org/assignments/message-headers"/>,
   as defined by <xref target="BCP90"/>.
</t>
<t>
   This document updates the definition of the "Accept-Encoding" header field,
   so the "Permanent Message Header Field Names" registry ought to be updated
   accordingly:
</t>
<texttable align="left" suppress-title="true" anchor="iana.header.registration.table">
   <ttcol>Header Field Name</ttcol>
   <ttcol>Protocol</ttcol>
   <ttcol>Status</ttcol>
   <ttcol>Reference</ttcol>

   <c>Accept-Encoding</c>
   <c>http</c>
   <c>standard</c>
   <c>
      <xref target="RFC7231"/>, Section 5.3.4,
      and <xref target="accept-encoding"/> of this document
   </c>
</texttable>
</section>
<section title="Status Code Registry">
<t>
   HTTP status codes are registered within the "Status Code" registry
   located at <eref target="http://www.iana.org/assignments/http-status-codes"/>.
</t>
<t>
   This document updates the definition of the status code 415 (Unsupported Media Type),
   so the "Status Code" registry ought to be updated
   accordingly:
</t>
<texttable align="left" suppress-title="true" anchor="iana.status.code.registration.table">
   <ttcol>Value</ttcol>
   <ttcol>Description</ttcol>
   <ttcol>Reference</ttcol>

   <c>415</c>
   <c>Unsupported Media Type</c>
   <c>
      <xref target="RFC7231"/>, Section 6.5.13,
      and <xref target="accept-encoding"/> of this document
   </c>
</texttable>
</section>
</section>

  </middle>
  <back>
  
<references title="Normative References">

<reference anchor="RFC2119" target="http://www.rfc-editor.org/info/rfc2119"><front>
    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
    <author initials="S." surname="Bradner" fullname="Scott Bradner">
      <organization>Harvard University</organization>
      <address><email>sob@harvard.edu</email></address>
    </author>
    <date month="March" year="1997"/>
  </front><seriesInfo name="BCP" value="14"/><seriesInfo name="RFC" value="2119"/><seriesInfo name="DOI" value="10.17487/RFC2119"/></reference>

<reference anchor="RFC7230" target="http://www.rfc-editor.org/info/rfc7230"><front>
    <title>Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</title>
    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
      <address><email>fielding@gbiv.com</email></address>
    </author>
    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
      <organization abbrev="greenbytes">greenbytes GmbH</organization>
      <address><email>julian.reschke@greenbytes.de</email></address>
    </author>
    <date month="June" year="2014"/>
  </front><seriesInfo name="RFC" value="7230"/><seriesInfo name="DOI" value="10.17487/RFC7230"/></reference>

<reference anchor="RFC7231" target="http://www.rfc-editor.org/info/rfc7231"><front>
    <title>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</title>
    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
      <address><email>fielding@gbiv.com</email></address>
    </author>
    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
      <organization abbrev="greenbytes">greenbytes GmbH</organization>
      <address><email>julian.reschke@greenbytes.de</email></address>
    </author>
    <date month="June" year="2014"/>
  </front><seriesInfo name="RFC" value="7231"/><seriesInfo name="DOI" value="10.17487/RFC7231"/></reference>

</references>

<references title="Informative References">
<reference anchor="BCP90" target="http://www.rfc-editor.org/info/bcp90"><front>
    <title>Registration Procedures for Message Header Fields</title>
    <author initials="G." surname="Klyne" fullname="G. Klyne">
      <organization>Nine by Nine</organization>
      <address><email>GK-IETF@ninebynine.org</email></address>
    </author>
    <author initials="M." surname="Nottingham" fullname="M. Nottingham">
      <organization>BEA Systems</organization>
      <address><email>mnot@pobox.com</email></address>
    </author>
    <author initials="J." surname="Mogul" fullname="J. Mogul">
      <organization>HP Labs</organization>
      <address><email>JeffMogul@acm.org</email></address>
    </author>
    <date year="2004" month="September"/>
  </front><seriesInfo name="BCP" value="90"/><seriesInfo name="RFC" value="3864"/></reference>
</references>

<section anchor="change.log" title="Change Log (to be removed by RFC Editor before publication)">

<section anchor="changes.since.r.00" title="Since draft-reschke-http-cice-00">
<t>
  Clarified that the information returned in Accept-Encoding is per resource, not per server.
</t>
<t>
  Added some deployment considerations.
</t>
<t>
  Updated HTTP/1.1 references.
</t>
</section>

<section anchor="changes.since.r.01" title="Since draft-reschke-http-cice-01">
<t>
  Restrict the scope of A-E from "future requests" to "at the time of this request".
</t>
<t>
  Mention use of A-E in responses other than 415.
</t>
<t>
  Recommend not to include A-E in a 415 response unless there was actually a problem related to content coding.
</t>
</section>

<section anchor="changes.since.r.02" title="Since draft-reschke-http-cice-02">
<t>
  First Working Group draft; updated boilerplate accordingly.
</t>
</section>

<section anchor="changes.since.00" title="Since draft-ietf-httpbis-cice-00">
<t>
  Apply editorial improvements suggested by Mark Nottingham.
</t>
</section>
<section anchor="changes.since.01" title="Since draft-ietf-httpbis-cice-01">
<t>
  Clarify that we're also extending the definition of status code 415
  (so update that IANA registry entry as well).
</t>
</section>
</section>

<section title="Acknowledgements">
<t>
  Thanks go to the members of the and HTTPbis Working Group, namely
  Amos Jeffries, Mark Nottingham, Pete Resnick, and Ted Hardie. 
</t>
</section>

  </back>

</rfc>