<?xml version="1.0"?>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- $Id: draft-murchison-webdav-prefer.xml,v 1.6 2012/09/27 21:01:37 ken Exp $ -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY rfc2616 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2616.xml'> 
<!ENTITY rfc4918 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4918.xml'> 
<!ENTITY rfc4791 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4791.xml'> 
<!ENTITY rfc3253 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3253.xml'> 
<!ENTITY rfc5689 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5689.xml'> 
<!ENTITY rfc2119 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'> 
<!ENTITY rfc3864 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3864.xml'>
<!ENTITY rfc5226 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5226.xml'>
<!ENTITY rfc2026 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2026.xml'>
<!ENTITY rfc5234 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5234.xml'>
<!ENTITY rfc6352 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6352.xml'>
<!ENTITY rfc5995 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5995.xml'>
<!ENTITY rfc6578 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6578.xml'>
<!ENTITY rfc6638 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6638.xml'>

<!ENTITY part1 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-httpbis-p1-messaging-20.xml'>
<!ENTITY part2 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-httpbis-p2-semantics-20.xml'>
<!ENTITY part3 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-httpbis-p3-payload-20.xml'>
<!ENTITY part4 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-httpbis-p4-conditional-20.xml'>
<!ENTITY part5 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-httpbis-p5-range-20.xml'>
<!ENTITY part6 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-httpbis-p6-cache-20.xml'>
<!ENTITY part7 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-httpbis-p7-auth-20.xml'>
<!ENTITY prefer PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-snell-http-prefer-14.xml'>
]>
<?rfc toc="yes"?> 
<?rfc strict="yes"?> 
<?rfc symrefs="yes" ?> 
<?rfc sortrefs="yes"?> 
<?rfc compact="yes"?> 
<rfc category="std" ipr="trust200902"
     updates="3253, 4791, 4918, 5689, 6352, 6578, 6638"
     docName="draft-murchison-webdav-prefer-00"> 
  <front> 
    <title abbrev="Prefer in WebDAV">
      Use of the Prefer Header Field in Web Distributed Authoring and
      Versioning (WebDAV)
    </title> 
 
    <author initials="K." surname="Murchison"
	    fullname="Kenneth Murchison">
      <organization abbrev="CMU">
	Carnegie Mellon University
      </organization>
      <address> 
	<postal>
	  <street>5000 Forbes Avenue</street>
<!--	  <street>Cyert Hall 285</street>-->
	  <city>Pittsburgh</city> <region>PA</region>
	  <code>15213</code> <country>US</country>
	</postal>
<!--	<phone>+1 412 268 2638</phone>-->
        <email>murch@andrew.cmu.edu</email> 
      </address> 
    </author> 
    
    <date month="September" year="2012" /> 
 
    <area>Applications</area> 
    <workgroup>Independent Submission</workgroup>

    <keyword>I-D</keyword> 
    <keyword>webdav</keyword> 
    <keyword>http</keyword> 
    <keyword>prefer</keyword> 
 
    <abstract>
      <t>This specification defines how the HTTP Prefer header
	can be used by a WebDAV client to request that certain behaviors
	be implemented by a server while constructing a response to a
	successful request.</t>
    </abstract>


  </front>
  
  <middle> 
    <section title="Introduction" anchor="intro">
 
      <t><xref target="I-D.snell-http-prefer"/> defines the HTTP
	Prefer request header field and the "return-minimal"
	preference which indicates that a client wishes for the server
	to return a minimal response to a successful request, but
	states that what constitutes an appropriate minimal response
	is left solely to the discretion of the server.
	<xref target="minimal"/> of this specification defines
	precisely what is expected of a server when constructing
	minimal responses to successful 
	<xref target="RFC4918">WebDAV</xref> requests.</t>

      <t><xref target="I-D.snell-http-prefer"/> also defines
	the "return-representaion"
	preference which indicates that a client wishes for the server
	to include an entity representing the current state of the
	resource in the response to a successful request.  The
	behavior of this preference with 
	<xref target="RFC4918">WebDAV</xref> requests needs no 
	further clarification, but <xref target="representation"/> of
	this specification makes recommendations on when it should be
	used by clients.</t>

      <t>Finally, <xref target="noroot"/> of this specifcation defines
	the "depth-noroot" preference that can be used
	with <xref target="RFC4918">WebDAV</xref> methods that support
	the "Depth" header field..</t>

      <section 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 references XML elements types in the
	  "DAV:" namespace outside of the context of an XML fragment.
	  When doing so, the string "DAV:" will be prepended to the
	  XML element type.</t>

      </section>

    </section> <!-- Introduction -->

    <section title='Reducing WebDAV Response Verbosity with
		    "return-minimal"' anchor="minimal">

      <t>Some payload bodies in responses
	to <xref target="RFC4918">WebDAV</xref> requests, such
	as <xref target="RFC4918">207 (Multi-Status)</xref> responses, can
	be quite verbose while entire payload bodies included in some
	success responses can be unnecessary at times.  This
	specification defines how
	the <xref target="I-D.snell-http-prefer">Prefer</xref> 
	request header field, in conjunction with its "return-minimal"
	preference, can be used by clients to reduce the verbosity of
	such responses by requesting that the server omit those
	portions of the response that can be inferred by their
	absence.</t>
      
      <section title="Minimal PROPFIND Response" anchor="propfind">

	<t>When a <xref target="RFC4918">PROPFIND</xref> method
	  request contains
	  a <xref target="I-D.snell-http-prefer">Prefer</xref> header
	  field with a preference of "return-minimal", the server SHOULD
	  omit all DAV:propstat XML elements containing a DAV:status
	  XML element of
	  value <xref target="I-D.ietf-httpbis-p2-semantics">404 (Not
	  Found)</xref> from
	  the <xref target="RFC4918">207 (Multi-Status)</xref> response.
	  If the omission of such a DAV:propstat element would result
	  in a DAV:response XML element containing zero DAV:propstat
	  elements, then the server MUST substitute a DAV:propstat
	  element consisting of an empty DAV:prop element and a
	  DAV:status element of
	  value <xref target="I-D.ietf-httpbis-p2-semantics"> 200
	  (OK)</xref> in its place.</t>

	<section title="Example: Typical PROPFIND request/response">

	  <figure>
	    <preamble>&gt;&gt; Request &lt;&lt;</preamble>
	    <artwork>
	      <![CDATA[
PROPFIND /container/ HTTP/1.1
Host: webdav.example.com
Content-Type: application/xml; charset=utf-8
Content-Length: xxxx

<?xml version="1.0" encoding="UTF-8"?>
<D:propfind xmlns:D="DAV:" xmlns:X="http://ns.example.com/foobar/">
  <D:prop>
    <D:resourcetype/>
    <X:foobar/>
  </D:prop>
</D:propfind>
]]>
	    </artwork>
	  </figure>

	  <figure>
	    <preamble>&gt;&gt; Response &lt;&lt;</preamble>
	    <artwork>
	      <![CDATA[
HTTP/1.1 207 Multi-Status
Content-Type: application/xml; charset=utf-8
Content-Length: xxxx

<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:" xmlns:X="http://ns.example.com/foobar/">
  <D:response>
    <D:href>/container/</D:href>
    <D:propstat>
      <D:prop>
        <D:resourcetype>
          <D:collection/>
        </D:resourcetype>
      </D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
    <D:propstat>
      <D:prop>
        <X:foobar/>
      </D:prop>
      <D:status>HTTP/1.1 404 Not Found</D:status>
    </D:propstat>
  </D:response>
</D:multistatus>
]]>
	    </artwork>
	  </figure>

	</section> <!-- PROPFIND example w/o Prefer -->

	<section title="Example: Minimal PROPFIND request/response">
	  <figure>
	    <preamble>&gt;&gt; Request &lt;&lt;</preamble>
	    <artwork>
	      <![CDATA[
PROPFIND /container/ HTTP/1.1
Host: webdav.example.com
Content-Type: application/xml; charset=utf-8
Content-Length: xxxx
Prefer: return-minimal

<?xml version="1.0" encoding="UTF-8"?>
<D:propfind xmlns:D="DAV:" xmlns:X="http://ns.example.com/foobar/">
  <D:prop>
    <D:resourcetype/>
    <X:foobar/>
  </D:prop>
</D:propfind>
]]>
	    </artwork>
	  </figure>

	  <figure>
	    <preamble>&gt;&gt; Response &lt;&lt;</preamble>
	    <artwork>
	      <![CDATA[
HTTP/1.1 207 Multi-Status
Content-Type: application/xml; charset=utf-8
Content-Length: xxxx

<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:">
  <D:response>
    <D:href>/container/</D:href>
    <D:propstat>
      <D:prop>
        <D:resourcetype>
          <D:collection/>
        </D:resourcetype>
      </D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>
</D:multistatus>
]]>
	    </artwork>
	  </figure>

	</section> <!-- PROPFIND example w/ Prefer -->

	<section title="Example: Minimal PROPFIND request/response
			with an empty DAV:propstat element">
	  <figure>
	    <preamble>&gt;&gt; Request &lt;&lt;</preamble>
	    <artwork>
	      <![CDATA[
PROPFIND /container/ HTTP/1.1
Host: webdav.example.com
Content-Type: application/xml; charset=utf-8
Content-Length: xxxx
Prefer: return-minimal

<?xml version="1.0" encoding="UTF-8"?>
<D:propfind xmlns:D="DAV:" xmlns:X="http://ns.example.com/foobar/">
  <D:prop>
    <X:foobar/>
  </D:prop>
</D:propfind>
]]>
	    </artwork>
	  </figure>

	  <figure>
	    <preamble>&gt;&gt; Response &lt;&lt;</preamble>
	    <artwork>
	      <![CDATA[
HTTP/1.1 207 Multi-Status
Content-Type: application/xml; charset=utf-8
Content-Length: xxxx

<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:">
  <D:response>
    <D:href>/container/</D:href>
    <D:propstat>
      <D:prop/>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>
</D:multistatus>
]]>
	    </artwork>
	  </figure>

	</section> <!-- PROPFIND example w/ Prefer and empty propstat -->

      </section> <!-- PROPFIND -->
 

      <section title="Minimal PROPPATCH Response" anchor="proppatch">

	<t>When a <xref target="RFC4918">PROPPATCH</xref>
	  request contains
	  a <xref target="I-D.snell-http-prefer">Prefer</xref> header
	  field with a preference of "return-minimal", and all
	  instructions are processed successfully, the server SHOULD
	  return a <xref target="I-D.ietf-httpbis-p2-semantics">200
	    (OK)</xref> response with an empty (zero-length) message body
	  instead of a <xref target="RFC4918">207 (Multi-Status)</xref>
	  response.</t>

	<section title="Example: Typical PROPPATCH request/response">
	  <figure>
	    <preamble>&gt;&gt; Request &lt;&lt;</preamble>
	    <artwork>
	      <![CDATA[
PROPPATCH /container/ HTTP/1.1
Host: webdav.example.com
Content-Type: application/xml; charset=utf-8
Content-Length: xxxx

<?xml version="1.0" encoding="utf-8"?>
<D:propertyupdate xmlns:D="DAV:">
  <D:set>
    <D:prop>
      <D:displayname>My Container</D:displayname>
    </D:prop>
  </D:set>
</D:propertyupdate>
]]>
	    </artwork>
	  </figure>

	  <figure>
	    <preamble>&gt;&gt; Response &lt;&lt;</preamble>
	    <artwork>
	      <![CDATA[
HTTP/1.1 207 Multi-Status
Content-Type: application/xml; charset=utf-8
Content-Length: xxxx

<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:">
  <D:response>
    <D:href>/container/</D:href>
    <D:propstat>
      <D:prop>
        <D:displayname/>
      </D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>
</D:multistatus>
]]>
	    </artwork>
	  </figure>

	</section> <!-- PROPPATCH example w/o Prefer -->


	<section title="Example: Minimal PROPPATCH request/response">
	  <figure>
	    <preamble>&gt;&gt; Request &lt;&lt;</preamble>
	    <artwork>
	      <![CDATA[
PROPPATCH /container/ HTTP/1.1
Host: webdav.example.com
Content-Type: application/xml; charset=utf-8
Content-Length: xxxx
Prefer: return-minimal

<?xml version="1.0" encoding="utf-8"?>
<D:propertyupdate xmlns:D="DAV:">
  <D:set>
    <D:prop>
      <D:displayname>My Container</D:displayname>
    </D:prop>
  </D:set>
</D:propertyupdate>
]]>
	    </artwork>
	  </figure>

	  <figure>
	    <preamble>&gt;&gt; Response &lt;&lt;</preamble>
	    <artwork>
	      <![CDATA[
HTTP/1.1 200 OK
Content-Length: 0

]]>
	    </artwork>
	  </figure>

	</section> <!-- PROPPATCH example w/ Prefer -->

      </section> <!-- PROPPATCH -->
  

      <section title="Minimal REPORT Response" anchor="report">

	<t>When a REPORT method request, whose report type results in
	  a <xref target="RFC4918">207 (Multi-Status)</xref> response,
	  contains a Prefer header field with a preference of
	  "return-minimal", the server SHOULD omit all DAV:propstat
	  XML elements containing a DAV:status XML element of
	  value <xref target="I-D.ietf-httpbis-p2-semantics">404 (Not
	  Found)</xref> from the <xref target="RFC4918">
	  207 (Multi-Status)</xref> response.
	  If the omission of such a DAV:propstat element would result
	  in a DAV:response XML element containing zero DAV:propstat
	  elements, then the server MUST substitute a DAV:propstat
	  element consisting of an empty DAV:prop element and a
	  DAV:status element of
	  value <xref target="I-D.ietf-httpbis-p2-semantics"> 200
	  (OK)</xref> in its place.</t>

	<section title="Example: Typical REPORT request/response">

	  <t>This example uses the
	    <xref target="RFC4791">CALDAV:calendar-multiget</xref> REPORT
	    type.</t>

	  <figure>
	    <preamble>&gt;&gt; Request &lt;&lt;</preamble>
	    <artwork>
	      <![CDATA[
REPORT /murch/work/ HTTP/1.1
Host: caldav.example.com
Content-Type: application/xml; charset=utf-8
Content-Length: xxxx

<?xml version="1.0" encoding="utf-8" ?>
<C:calendar-multiget xmlns:C="urn:ietf:params:xml:ns:caldav"
		     xmlns:D="DAV:"
		     xmlns:X="http://ns.example.com/foobar/">
  <D:prop>
    <D:getetag/>
    <X:foobar/>
  </D:prop>
  <D:href>/murch/work/abc.ics</D:href>
  <D:href>/murch/work/qrs.ics</D:href>
  <D:href>/murch/work/xyz.ics</D:href>
</C:calendar-multiget>
]]>
	    </artwork>
	  </figure>

	  <figure>
	    <preamble>&gt;&gt; Response &lt;&lt;</preamble>
	    <artwork>
	      <![CDATA[
HTTP/1.1 207 Multi-Status
Content-Type: application/xml; charset=utf-8
Content-Length: xxxx

<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:C="urn:ietf:params:xml:ns:caldav"
	       xmlns:D="DAV:"
	       xmlns:X="http://ns.example.com/foobar/">
  <D:response>
    <D:href>/murch/work/abc.ics</D:href>
    <D:propstat>
      <D:prop>
        <D:getetag>"jahsd823ru"</D:getetag>
      </D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
    <D:propstat>
      <D:prop>
        <X:foobar/>
      </D:prop>
      <D:status>HTTP/1.1 404 Not Found</D:status>
    </D:propstat>
  </D:response>
  <D:response>
    <D:href>/murch/work/qrs.ics</D:href>
    <D:status>HTTP/1.1 404 Not Found</D:status>
  </D:response>
    <D:href>/murch/work/xyz.ics</D:href>
    <D:propstat>
      <D:prop>
        <D:getetag>"p08ulkj"</D:getetag>
      </D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
    <D:propstat>
      <D:prop>
        <X:foobar/>
      </D:prop>
      <D:status>HTTP/1.1 404 Not Found</D:status>
    </D:propstat>
  </D:response>
</D:multistatus>
]]>
	    </artwork>
	  </figure>

	</section> <!-- REPORT example w/o Prefer -->


	<section title="Example: Minimal REPORT request/response">

	  <t>This example uses the
	    <xref target="RFC4791">CALDAV:calendar-multiget</xref> REPORT
	    type.</t>

	  <figure>
	    <preamble>&gt;&gt; Request &lt;&lt;</preamble>
	    <artwork>
	      <![CDATA[
REPORT /murch/work/ HTTP/1.1
Host: caldav.example.com
Content-Type: application/xml; charset=utf-8
Content-Length: xxxx
Prefer: return-minimal

<?xml version="1.0" encoding="utf-8" ?>
<C:calendar-multiget xmlns:C="urn:ietf:params:xml:ns:caldav"
		     xmlns:D="DAV:"
		     xmlns:X="http://ns.example.com/foobar/">
  <D:prop>
    <D:getetag/>
    <X:foobar/>
  </D:prop>
  <D:href>/murch/work/abc.ics</D:href>
  <D:href>/murch/work/qrs.ics</D:href>
  <D:href>/murch/work/xyz.ics</D:href>
</C:calendar-multiget>
]]>
	    </artwork>
	  </figure>

	  <figure>
	    <preamble>&gt;&gt; Response &lt;&lt;</preamble>
	    <artwork>
	      <![CDATA[
HTTP/1.1 207 Multi-Status
Content-Type: application/xml; charset=utf-8
Content-Length: xxxx

<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:C="urn:ietf:params:xml:ns:caldav"
	       xmlns:D="DAV:">
  <D:response>
    <D:href>/murch/work/abc.ics</D:href>
    <D:propstat>
      <D:prop>
        <D:getetag>"jahsd823ru"</D:getetag>
      </D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>
  <D:response>
    <D:href>/murch/work/qrs.ics</D:href>
    <D:status>HTTP/1.1 404 Not Found</D:status>
  </D:response>
    <D:href>/murch/work/xyz.ics</D:href>
    <D:propstat>
      <D:prop>
        <D:getetag>"p08ulkj"</D:getetag>
      </D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>
</D:multistatus>
]]>
	    </artwork>
	  </figure>

	</section> <!-- REPORT example w/ Prefer -->

      </section> <!-- REPORT -->
  

      <section title="Minimal MKCALENDAR / MKCOL Response"
	       anchor="mkcol">

	<t>Both the <xref target="RFC4791">MKCALENDAR</xref> and
	  <xref target="RFC5689">Extended MKCOL</xref> specifications
	  indicate that a server MAY return a message body in response
	  to a successful request.  This specification explicitly
	  defines the intended behavior in the presence of
	  the <xref target="I-D.snell-http-prefer">Prefer</xref>
	  header field.</t>

	<t>When a MKCALENDAR or an Extended MKCOL request
	  contains a Prefer header field with a preference of
	  "return-minimal", and the collection is created with all
	  requested properties being set successfully, the server SHOULD
	  return a <xref target="I-D.ietf-httpbis-p2-semantics">201
	    (Created)</xref> response with an empty (zero-length) message
	  body.</t>

	<section title="Example: Verbose MKCOL request/response">
	  <figure>
	    <preamble>&gt;&gt; Request &lt;&lt;</preamble>
	    <artwork>
	      <![CDATA[
MKCOL /container/ HTTP/1.1
Host: webdav.example.com
Content-Type: application/xml; charset=utf-8
Content-Length: xxxx

<?xml version="1.0" encoding="utf-8"?>
<D:mkcol xmlns:D="DAV:">
  <D:set>
    <D:prop>
      <D:displayname>My Container</D:displayname>
    </D:prop>
  </D:set>
</D:mkcol>
]]>
	    </artwork>
	  </figure>

	  <figure>
	    <preamble>&gt;&gt; Response &lt;&lt;</preamble>
	    <artwork>
	      <![CDATA[
HTTP/1.1 201 Created
Cache-Control: no-cache
Content-Type: application/xml; charset=utf-8
Content-Length: xxxx

<?xml version="1.0" encoding="utf-8"?>
<D:mkcol-response xmlns:D="DAV:">
  <D:propstat>
    <D:prop>
      <D:displayname/>
    </D:prop>
    <D:status>HTTP/1.1 200 OK</D:status>
  </D:propstat>
</D:mkcol-response>
]]>
	    </artwork>
	  </figure>

	</section> <!-- MKCOL example w/o Prefer -->


	<section title="Example: Minimal MKCOL request/response">
	  <figure>
	    <preamble>&gt;&gt; Request &lt;&lt;</preamble>
	    <artwork>
	      <![CDATA[
MKCOL /container/ HTTP/1.1
Host: webdav.example.com
Content-Type: application/xml; charset=utf-8
Content-Length: xxxx
Prefer: return-minimal

<?xml version="1.0" encoding="utf-8"?>
<D:mkcol xmlns:D="DAV:">
  <D:set>
    <D:prop>
      <D:displayname>My Container</D:displayname>
    </D:prop>
  </D:set>
</D:mkcol>
]]>
	    </artwork>
	  </figure>

	  <figure>
	    <preamble>&gt;&gt; Response &lt;&lt;</preamble>
	    <artwork>
	      <![CDATA[
HTTP/1.1 201 Created
Cache-Control: no-cache
Content-Length: 0

]]>
	    </artwork>
	  </figure>

	</section> <!-- MKCOL example w/ Prefer -->

      </section> <!-- MKCALENDAR/MKCOL -->
  
    </section> <!-- return-minimal -->

    <section title='Reducing WebDAV Round-Trips with
		    "return-representation"' anchor="representation">

      <t>The <xref target="RFC4918">PUT</xref>
	and <xref target="RFC5689">POST</xref> methods can be used to
	create or update a resource.  In some instances, such as
	with <xref target="RFC6638">CalDAV
	Scheduling</xref>, the created or updated resource representation
	may differ from the representation sent in the body of the
	request. In cases where the client would normally issue a
	subsquent GET request to retrieve the current representation of
	the resource, the client SHOULD instead include a Prefer
	header field with the "return-representation" preference in
	the PUT or POST request.  By doing this, the client can
	coalesce the create/update and retrieve operations into one
	round-trip rather than two.</t>

      <section title="Example: Typical resource creation and retrieval
		      via POST + GET">

	<figure>
	  <preamble>&gt;&gt; Request &lt;&lt;</preamble>
	  <artwork>
	    <![CDATA[
POST /murch/work;add-member/ HTTP/1.1
Host: caldav.example.com
Content-Type: text/calendar; charset=utf-8
Content-Length: xxxx

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Example Corp.//CalDAV Client//EN
BEGIN:VEVENT
UID:CD87465FA
SEQUENCE:0
DTSTAMP:20120602T185254Z
DTSTART:20120602T160000Z
DTEND:20120602T170000Z
TRANSP:OPAQUE
SUMMARY:Lunch
ORGANIZER;CN="Ken Murchison":mailto:murch@example.com
ATTENDEE;CN="Ken Murchison";CUTYPE=INDIVIDUAL;PARTSTAT=ACCEPTED:
 mailto:murch@example.com
ATTENDEE;CN="John Doe";CUTYPE=INDIVIDUAL;PARTSTAT
 =NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE:mailto:jdoe@
 example.com
END:VEVENT
END:VCALENDAR
]]>
	  </artwork>
	</figure>

	<figure>
	  <preamble>&gt;&gt; Response &lt;&lt;</preamble>
	  <artwork>
	    <![CDATA[
HTTP/1.1 201 Created
Location: http://caldav.example.com/murch/work/abc.ics
Content-Length: 0
ETag: "nahduyejc"
Schedule-Tag: "jfd84hgbcn"

]]>
	    </artwork>
	  </figure>

	<figure>
	  <preamble>&gt;&gt; Request &lt;&lt;</preamble>
	  <artwork>
	    <![CDATA[
GET /murch/work/abc.ics HTTP/1.1
Host: caldav.example.com

]]>
	  </artwork>
	</figure>

	<figure>
	  <preamble>&gt;&gt; Response &lt;&lt;</preamble>
	  <artwork>
	    <![CDATA[
HTTP/1.1 200 OK
Content-Type: text/calendar; charset=utf-8
Content-Length: xxxx
ETag: "nahduyejc"
Schedule-Tag: "jfd84hgbcn"

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Example Corp.//CalDAV Server//EN
BEGIN:VEVENT
UID:CD87465FA
SEQUENCE:0
DTSTAMP:20120602T185300Z
DTSTART:20120602T160000Z
DTEND:20120602T170000Z
TRANSP:OPAQUE
SUMMARY:Lunch
ORGANIZER;CN="Ken Murchison":mailto:murch@example.com
ATTENDEE;CN="Ken Murchison";CUTYPE=INDIVIDUAL;PARTSTAT=ACCEPTED:
 mailto:murch@example.com
ATTENDEE;CN="John Doe";CUTYPE=INDIVIDUAL;PARTSTAT
 =NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE;SCHEDULE-STATUS=
 1.2:mailto:jdoe@example.com
END:VEVENT
END:VCALENDAR
]]>
	    </artwork>
	  </figure>

	</section> <!-- POST example w/o Prefer -->

      <section title="Example: Streamlined resource creation and
		      retrieval via POST">

	<figure>
	  <preamble>&gt;&gt; Request &lt;&lt;</preamble>
	  <artwork>
	    <![CDATA[
POST /murch/work;add-member/ HTTP/1.1
Host: caldav.example.com
Content-Type: text/calendar; charset=utf-8
Content-Length: xxxx
Prefer: return-representation

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Example Corp.//CalDAV Client//EN
BEGIN:VEVENT
UID:CD87465FA
SEQUENCE:0
DTSTAMP:20120602T185254Z
DTSTART:20120602T160000Z
DTEND:20120602T170000Z
TRANSP:OPAQUE
SUMMARY:Lunch
ORGANIZER;CN="Ken Murchison":mailto:murch@example.com
ATTENDEE;CN="Ken Murchison";CUTYPE=INDIVIDUAL;PARTSTAT=ACCEPTED:
 mailto:murch@example.com
ATTENDEE;CN="John Doe";CUTYPE=INDIVIDUAL;PARTSTAT
 =NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE:mailto:jdoe@
 example.com
END:VEVENT
END:VCALENDAR
]]>
	  </artwork>
	</figure>

	<figure>
	  <preamble>&gt;&gt; Response &lt;&lt;</preamble>
	  <artwork>
	    <![CDATA[
HTTP/1.1 201 Created
Location: http://caldav.example.com/murch/work/abc.ics
Content-Type: text/calendar; charset=utf-8
Content-Length: xxxx
ETag: "nahduyejc"
Schedule-Tag: "jfd84hgbcn"

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Example Corp.//CalDAV Server//EN
BEGIN:VEVENT
UID:CD87465FA
SEQUENCE:0
DTSTAMP:20120602T185300Z
DTSTART:20120602T160000Z
DTEND:20120602T170000Z
TRANSP:OPAQUE
SUMMARY:Lunch
ORGANIZER;CN="Ken Murchison":mailto:murch@example.com
ATTENDEE;CN="Ken Murchison";CUTYPE=INDIVIDUAL;PARTSTAT=ACCEPTED:
 mailto:murch@example.com
ATTENDEE;CN="John Doe";CUTYPE=INDIVIDUAL;PARTSTAT
 =NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE;SCHEDULE-STATUS=
 1.2:mailto:jdoe@example.com
END:VEVENT
END:VCALENDAR
]]>
	    </artwork>
	  </figure>

	</section> <!-- POST example w/ Prefer -->

    </section> <!-- return-representation -->


    <section title='The "depth-noroot" Processing Preference'
	     anchor="noroot">

      <t>The "depth-noroot" preference indicates that the client
      wishes for the server to exclude the target (root) resource from
      processing by the WebDAV method and only apply the WebDAV method
      to the target resource's subordinate resources.</t>

      <figure>
	<artwork>
depth-noroot = "depth-noroot"
	</artwork>
      </figure>

      <t>This preference is only intended to be used with WebDAV
      methods whose definitions explicitly provide support for the
      <xref target="RFC4918">Depth</xref> header field.
      Furthermore, this preference only applies when the Depth
      header field has a value of "1" or "infinity" (either
      implicitly or explicitly).</t>

      <t>The "depth-noroot" preference MAY be used in conjunction with
	the "return-minimal" preference in a single request.</t>

      <section title="Example: Typical PROPFIND request/response with Depth:1">
	<figure>
	  <preamble>&gt;&gt; Request &lt;&lt;</preamble>
	  <artwork>
	    <![CDATA[
PROPFIND /murch/ HTTP/1.1
Host: dav.example.com
Content-Type: text/xml
Content-Length: xxx
Depth: 1

<?xml version="1.0" encoding="UTF-8"?>
<D:propfind xmlns:D="DAV:">
  <D:prop>
    <D:sync-token/>
  </D:prop>
</D:propfind>
]]>
	  </artwork>
	</figure>

	<figure>
	  <preamble>&gt;&gt; Response &lt;&lt;</preamble>
	  <artwork>
	    <![CDATA[
HTTP/1.1 207 Multi-Status
Content-Type: application/xml; charset=utf-8
Content-Length: xxxx

<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:">
  <D:response>
    <D:href>/murch/</D:href>
    <D:propstat>
      <D:prop>
        <D:sync-token>http://example.com/ns/sync/2216-2</D:sync-token>
      </D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>
  <D:response>
    <D:href>/murch/work/</D:href>
    <D:propstat>
      <D:prop>
        <D:sync-token>http://example.com/ns/sync/2136-34</D:sync-token>
      </D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>
  <D:response>
    <D:href>/murch/home/</D:href>
    <D:propstat>
      <D:prop>
        <D:sync-token>http://example.com/ns/sync/2141-19</D:sync-token>
      </D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>
</D:multistatus>
]]>
	  </artwork>
	</figure>

      </section> <!-- PROPFIND example w/o Prefer -->

      <section title="Example: PROPFIND request/response with
		      Depth:1 and Prefer:depth-noroot">
	<figure>
	  <preamble>&gt;&gt; Request &lt;&lt;</preamble>
	  <artwork>
	    <![CDATA[
PROPFIND /murch/ HTTP/1.1
Host: dav.example.com
Content-Type: text/xml
Content-Length: xxx
Depth: 1
Prefer: depth-noroot

<?xml version="1.0" encoding="UTF-8"?>
<D:propfind xmlns:D="DAV:">
  <D:prop>
    <D:sync-token/>
  </D:prop>
</D:propfind>
]]>
	  </artwork>
	</figure>

	<figure>
	  <preamble>&gt;&gt; Response &lt;&lt;</preamble>
	  <artwork>
	    <![CDATA[
HTTP/1.1 207 Multi-Status
Content-Type: application/xml; charset=utf-8
Content-Length: xxxx

<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:">
  <D:response>
    <D:href>/murch/work/</D:href>
    <D:propstat>
      <D:prop>
        <D:sync-token>http://example.com/ns/sync/2136-34</D:sync-token>
      </D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>
  <D:response>
    <D:href>/murch/home/</D:href>
    <D:propstat>
      <D:prop>
        <D:sync-token>http://example.com/ns/sync/2141-19</D:sync-token>
      </D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>
</D:multistatus>
]]>
	  </artwork>
	</figure>
      </section> <!-- PROPFIND example w/ Prefer -->

    </section> <!-- depth-noroot -->


    <section title="Security Considerations"> 

      <t>No new security considerations are introduced by use of the
	Prefer header field with WebDAV request methods, beyond those
	discussed in <xref target="I-D.snell-http-prefer"/> and those
	already inherent in those methods.</t>

    </section>


    <section title="IANA Considerations">

      <t>The following preference is to be added to the Preferences
      Registry defined in <xref target="I-D.snell-http-prefer"/>.</t>

      <t><list style="symbols">
	  <t>Preference: depth-noroot</t>
	  <t>Description: The "depth-noroot" preference indicates that
	    the client wishes for the server to exclude the target
	    (root) resource from processing by the WebDAV method and
	    only apply the WebDAV method to the target resource's
	    subordinate resources.</t>
	  <t>Reference: <xref target="noroot"/></t>
	  <t>Notes: This preference is only intended to be used with WebDAV
	    methods whose definitions explicitly provide support for the
	    <xref target="RFC4918">"Depth"</xref> header field.
	    Furthermore, this preference only applies when the "Depth"
	    header field has a value of "1" or "infinity" (either
	    implicitly or explicitly).</t>
      </list></t>

    </section>


    <section title="Acknowledgements">

      <t>The author would like to thank the following individuals for
      contributing their ideas and support for writing this
      specification: Cyrus Daboo, Helge Hess, Andrew McMillan, and Arnaud
      Quillaud.</t>

      <t>The author would also like to thank the Calendaring and
      Scheduling Consortium for advice with this specification, and
      for organizing interoperability testing events to help refine
      it.</t>

    </section>

  </middle> 


  <back>
    <references title="Normative References">
      &rfc2119;
      &rfc3253;
      &rfc4918;
      &rfc5689;
      &rfc5995;
      &prefer;
      &part2;
    </references>

    <references title="Informative References">
      &rfc4791;
      &rfc6578;
      &rfc6638;

      <reference anchor="MSDN.aa563501">
	<front>
	  <title>Brief Header</title>
	  <author>
	    <organization>Microsoft Developer Network</organization>
	  </author>
	  <date month="June" year="2006"/>
	</front>
	<format type="HTML"
	target="http://msdn.microsoft.com/en-us/library/aa563501.aspx"/>
      </reference>
      <reference anchor="MSDN.aa580336">
	<front>
	  <title>PROPFIND Method</title>
	  <author>
	    <organization>Microsoft Developer Network</organization>
	  </author>
	  <date month="June" year="2006"/>
	</front>
	<format type="HTML"
	target="http://msdn.microsoft.com/en-us/library/aa580336.aspx"/>
      </reference>
      <reference anchor="MSDN.aa493854">
	<front>
	  <title>PROPPATCH Method</title>
	  <author>
	    <organization>Microsoft Developer Network</organization>
	  </author>
	  <date month="June" year="2006"/>
	</front>
	<format type="HTML"
	target="http://msdn.microsoft.com/en-us/library/aa493854.aspx"/>
      </reference>
      <reference anchor="MSDN.aa563950">
	<front>
	  <title>Depth Header</title>
	  <author>
	    <organization>Microsoft Developer Network</organization>
	  </author>
	  <date month="June" year="2006"/>
	</front>
	<format type="HTML"
	target="http://msdn.microsoft.com/en-us/library/aa563950.aspx"/>
      </reference>
    </references>


    <section title="The Brief and Extended Depth Request Header Fields">
      <t>This document is based heavily on
	the <xref target="MSDN.aa563501">Brief</xref>
	and <xref target="MSDN.aa563950">extended Depth</xref> request header
	fields.  The behaviors described in <xref target="propfind"/>
	and <xref target="proppatch"/> are identical to those provided
	by the Brief header field when used with
	the <xref target="MSDN.aa580336">PROPFIND</xref>
	and <xref target="MSDN.aa493854">PROPPATCH</xref> methods
	respectively.  The behavior described in
	<xref target="noroot"/> is identical to that provided by
	the <xref target="MSDN.aa563950">"1,noroot"</xref>
	and <xref target="MSDN.aa563950">"infinity,noroot"</xref> Depth
	header field values.</t>

      <t>Authors are encouraged to implement the Brief header field
	functionality in conjunction with this specification to
	further promote interoperability with products that use the
	Brief header field exclusively.</t>
    </section>


    <section title="Open Issues">
      <t><list style="symbols">
	  <t>Have we settled on the proper server behavior when
	  "return-minimal" would result in zero DAV:propstat
	  elements?</t>

	  <t>Are there any other use cases for "return-minimal"
	    and/or "return-representation" that we should
	    document (COPY/MOVE, versioning extensions)?</t>
      </list></t>
    </section>

    <section title="Change Log (to be removed by RFC Editor before
		    publication)">
      <section title="Since CalConnect XXIV">
	<t><list style="symbols">
	    <t>Updated references.</t>
	    <t>Stated that "depth-noroot" can be used in conjuction
	      with "return-minimal".</t>
	    <t>Added text mentioning that "depth-noroot" is based on
	      the MSDN "1,noroot" and "infinity,noroot" Depth header
	      values.</t>
	    <t>The server behavior required when "return-minimal" would
	      result in zero DAV:propstat elements has been changed
	      <figure>
		<preamble>from:</preamble>
		<artwork>
		  <![CDATA[
<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:">
  <D:response>
    <D:href>/container/</D:href>
    <D:status>HTTP/1.1 200 OK</D:status>
  </D:response>
</D:multistatus>
]]>
		</artwork>
	      </figure>
	      <figure>
		<preamble>to the slightly more verbose:</preamble>
		<artwork>
		  <![CDATA[
<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:">
  <D:response>
    <D:href>/container/</D:href>
    <D:propstat>
      <D:prop/>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>
</D:multistatus>
]]>
		</artwork>
	      </figure>
	    </t>
	</list></t>
      </section>
    </section>

  </back>
</rfc> 
