<?xml version="1.0"?>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY rfc2119 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.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 rfc3744 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3744.xml'> 
<!ENTITY rfc5689 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5689.xml'> 
<!ENTITY rfc5789 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5789.xml'>
<!ENTITY rfc5995 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5995.xml'>
<!ENTITY rfc6352 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6352.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 rfc7942 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7942.xml'>
<!ENTITY rfc7231 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7231.xml'>
<!ENTITY rfc7232 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7232.xml'>
<!ENTITY rfc7240 PUBLIC ''
	 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7240.xml'>
]>

<?rfc toc="yes"?> 
<?rfc strict="yes"?> 
<?rfc symrefs="yes" ?> 
<?rfc sortrefs="yes"?> 
<?rfc compact="yes"?> 
<rfc category="std" ipr="trust200902"
     updates="3253, 4918, 4791, 5689, 5789, 5995, 6352, 7231, 7232 7240"
     docName="draft-murchison-webdav-prefer-10"> 
  <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>USA</country>
	</postal>
	<phone>+1 412 268 1982</phone>
        <email>murch@andrew.cmu.edu</email> 
      </address> 
    </author> 
    
<!--    <date month="October" year="2016" /> -->
    <date/> 
 
    <area>Applications</area> 
    <workgroup>Independent Submission</workgroup>

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

    <note title="Editorial Note (To be removed by RFC Editor before
		 publication)">
      <t>Please send comments to the Web Distributed Authoring and
      Versioning (WebDAV) mailing list at <eref
      target="mailto:w3c-dist-auth@w3.org">
      &lt;mailto:w3c-dist-auth@w3.org&gt;</eref>, 
      which may be joined by sending a message with subject
      "subscribe" to <eref
      target="mailto:w3c-dist-auth-request@w3.org?subject=subscribe">
      &lt;mailto:w3c-dist-auth-request@w3.org&gt;</eref>.
      This mailing list is archived at <eref
      target="http://lists.w3.org/Archives/Public/w3c-dist-auth/">
      &lt;http://lists.w3.org/Archives/Public/w3c-dist-auth/&gt;</eref>.
      </t>
    </note>

    <note title='Open Issues'>
      <t>
        <list style='symbols'>
          <t>Should the list of updated RFCs (other than RFC 7240) in
          the title page header only contain those whose method
          responses have been altered by this document?  Or should all
          potentially effected methods/protocols be listed?</t>
          
          <t>Should we add any text regarding caching responses in
          <xref target="representation"/>?</t>

          <t>Should we update the HTTP Status Code Registry to add a
          reference to <xref target="state-fail"/> for 412
          (Precondition Failed)?</t>
        </list>
      </t>
    </note>

  </front>
  
  <middle> 
    <section title="Introduction" anchor="intro">
 
      <t><xref target="RFC7240"/> 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="RFC7240"/> also defines
	the "return=representation"
	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.

	<xref target="representation"/> of this specification makes
	recommendations on when this preference should be used by
	clients and extends its applicability to <xref
	target="RFC7232">412 (Precondition
	Failed)</xref> responses.</t>

      <t>Finally, <xref target="noroot"/> of this specification defines
	the "depth-noroot" preference that can be used with WebDAV
	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 element types in the
	  <xref target="RFC4918">"DAV:"</xref>, <xref
          target="RFC4791">"urn:ietf:params:xml:ns:caldav"</xref>, and
          <xref
              target="RFC6352">"urn:ietf:params:xml:ns:carddav"</xref>
          namespaces outside of
	  the context of an XML fragment.  When doing so, the strings
	  "DAV:", "CALDAV:", and "CARDDAV:" will be
          prepended to the XML element types respectively.</t> 

      </section> <!-- Notational -->

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

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

      <t>Some payload bodies in responses
	to WebDAV requests, such
	as <xref target="RFC4918">207 (Multi-Status)</xref> responses, can
	be quite verbose or even unnecessary at times.  This
	specification defines how
	the Prefer
	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 and REPORT Responses" anchor="propfind">

	<t>When a <xref target="RFC4918">PROPFIND</xref>
	  request, or a  <xref target="RFC3253">REPORT</xref> request
	  whose report type results in a 207 (Multi-Status) 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="RFC7231">404 (Not
	  Found)</xref> from the 207 (Multi-Status) response.

	  If the omission of such a DAV:propstat element would result
	  in a DAV:response XML element containing zero DAV:propstat
	  elements, the server MUST substitute one of the
	  following in its place:
	  <list style="symbols">
	    <t>a DAV:propstat element consisting of an empty DAV:prop
	    element and a DAV:status element of value <xref
	    target="RFC7231"> 200
	    (OK)</xref></t>

	    <t>a DAV:status element of value 200 (OK)</t>
	  </list>
	</t>

        <t>The following report types are candidates that could
        benefit from use of the "return=minimal" preference.  NOTE:
        This list is not intended to be normative or exhaustive.

        <list style="symbols">
          <t><xref target="RFC3253">DAV:expand-property</xref></t>

          <t><xref target="RFC3744">DAV:acl-principal-prop-set</xref></t>

          <t><xref target="RFC3744">DAV:principal-property-search</xref></t>

          <t><xref target="RFC6578">DAV:sync-collection</xref></t>

          <t><xref target="RFC4791">CALDAV:calendar-query</xref></t>

          <t><xref target="RFC4791">CALDAV:calendar-multiget</xref></t>

          <t><xref target="RFC6352">CARDDAV:addressbook-query</xref></t>

          <t><xref target="RFC6352">CARDDAV:addressbook-multiget</xref></t>
        </list>
        </t>
<!--
	<texttable>
	  <ttcol>[Open Issue: Is there a technical justification for
	  the following text?  If yes, should this be a MUST?  If no,
	  remove it.]</ttcol>
	</texttable>

	<t>If the server honors and applies the "return=minimal"
	preference to the processing of a PROPFIND request as
	described above, the server SHOULD include a <xref
	target="RFC7240">Preference-Applied</xref>
	header field containing the "return=minimal" token in the
	response.</t>
-->

        <t>See <xref target="propfind-examples"/> and
        <xref target="report-examples"/> for examples.</t>

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

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

	<t>When a <xref target="RFC4918">PROPPATCH</xref> request
	  contains a Prefer header field with a preference of
	  "return=minimal", and all instructions are processed
	  successfully, the server SHOULD return
	  one of the following responses rather than a 207
	  (Multi-Status) response:
	  <list style="symbols">
	    <t><xref target="RFC7231">204 (No
	    Content)</xref></t>

	    <t><xref target="RFC7231">200
	    (OK)</xref> (preferably with a zero-length message body)</t>
	  </list>
	</t>

        <t>See <xref target="proppatch-examples"/> for examples.</t>

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

      <section title="Minimal MKCALENDAR and MKCOL Responses"
	       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 Prefer 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="RFC7231">201
	  (Created)</xref> response with an empty (zero-length)
	  message body.</t>

	  <t>Note that the rationale for requiring that a minimal
	  success response have an empty body is twofold:

	  <list style="symbols">
	    <t><xref target="RFC4791"/> Section 5.3.1 states: "If a
	    response body for a successful request is included, it
	    MUST be a CALDAV:mkcalendar-response XML element."</t>

	    <t><xref target="RFC5689"/> Section 3 states: "When an
	    empty response body is returned with a success request
	    status code, the client can assume that all properties
	    were set."</t>
	  </list>
	  </t>

        <t>See <xref target="mkcol-examples"/> for examples.</t>

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

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

      <t><xref target="RFC7240"/> describes the "return=representation"
      preference as being intended to provide a means of optimizing
      communication between the client and server by eliminating the
      need for a subsequent GET request to retrieve the current
      representation of the resource following a modification.  This
      preference is equally applicable to situations where the server
      itself modifies a resource, and where a resource has been
      modified by another client.</t>

      <section title='Successful State-Changing Requests'
               anchor='state-success'>        
        <t>The state-changing methods <xref target="RFC7231">PUT</xref>,
        <xref target="RFC4918">COPY/MOVE</xref>, 
        <xref target="RFC5789">PATCH</xref>,
        and <xref target="RFC5995">POST</xref> 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 or referenced by the effective request URI.  In cases
        where the client, upon receiving a
        <xref target="RFC7231">2xx (Successful)</xref> response 
        to its state-changing request, would normally issue a
        subsequent GET request to retrieve the current representation
        of the resource, the client can instead include a Prefer
        header field with the "return=representation" preference in
        the state-changing request.</t>

        <t>When a state-changing request contains a Prefer header field
        with a preference of "return=representation", and the resource
        is created or updated successfully, the server SHOULD include
        an entity representating the current state resource in the
        resulting <xref target="RFC7231">201 (Created) or 200
        (OK)</xref> response. In addition to coalescing the
        create/update and retrieve operations into a single 
        round-trip, by returning the current representation of the
        resource in the response the client will know that any changes
        to the resource were produced by the server rather than a
        concurrent client, thus providing a level of atomicity to the
        operation.</t>

        <t>See <xref target="post-examples"/> for examples.</t>

      </section>

      <section title='Unsuccessful Conditional State-Changing
                      Requests' anchor='state-fail'>

        <t>Frequently, clients using a state-changing method such as
        those listed above will make them conditional by including
        either an <xref target="RFC7232">If-Match or
        If-None-Match</xref> header field in the request. This is done
        to prevent the client from accidentially overwriting a
        resource whose current state has been modified by another
        client acting in parallel.  In cases
        where the client, upon receiving a <xref target="RFC7232">412
        (Precondition Failed)</xref> response to its conditional
        state-changing request, would normally issue a subsequent GET request
        to retrieve the current representation of the resource, the
        client can instead include a Prefer header field with the
        "return=representation" preference in the conditional
        state-changing request.</t>

        <t>When a conditional state-changing request contains a Prefer
        header field with a preference of "return=representation", and
        the specified condition evaluates to false, the server SHOULD
        include an entity representing the current state of the
        resource in the resulting <xref target="RFC7232">412 
        (Precondition Failed)</xref> response.</t>

        <t>See <xref target="put-examples"/> for examples.</t>

      </section>

    </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>

        <t>See <xref target="propfind-examples"/> for examples.</t>

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


    <section title="Implementation Status" anchor="impl">

      <t>&lt; RFC Editor: before publication please remove this section
	and the reference to <xref target="RFC7942"/> &gt;</t>

      <t>This section records the status of known implementations of
	the protocol defined by this specification at the time of
	posting of this Internet-Draft, and is based on a proposal
	described in <xref target="RFC7942"/>.  The
	description of implementations in this section is intended to
	assist the IETF in its decision processes in progressing
	drafts to RFCs.  Please note that the listing of any
	individual implementation here does not imply endorsement by
	the IETF.  Furthermore, no effort has been spent to verify the
	information presented here that was supplied by IETF
	contributors.  This is not intended as, and must not be
	construed to be, a catalog of available implementations or
	their features.  Readers are advised to note that other
	implementations may exist.</t>

	<t>According to <xref target="RFC7942"/>,
	"this will allow reviewers and working groups to assign due
	consideration to documents that have the benefit of running
	code, which may serve as evidence of valuable
	experimentation and feedback that have made the implemented
	protocols more mature.  It is up to the individual working
	groups to use this information as they see fit".</t>

      <section title="Cyrus" anchor="cyrus" toc="exclude">

	<t>The open source <eref
	target="http://www.cyrusimap.org/">Cyrus</eref> project is a 
	highly scalable enterprise mail system which also supports
	calendaring and contacts.  This production level CalDAV/CardDAV
	implementation supports all of the preferences described in
	this document and successfully interoperates with the <xref
	target="caldavtester" format="title"/>, <xref target="apple"
        format="title"/>, and  <xref 
	target="acal" format="title"/> client 
	implementations described below.  This implementation is
	freely distributable under a BSD style license from
	<eref target="http://www.cmu.edu/computing/">Computing
	Services at Carnegie Mellon University</eref>.</t> 
      </section>

      <section title="Calendar and Contacts Server"
	       anchor="calendarserver" toc="exclude"> 

	<t>The open
	  source <eref target="http://calendarserver.org/">Calendar
	  and Contacts Server</eref> project is a standards-compliant
	  server implementing the CalDAV and CardDAV protocols.  This
	  production level implementation supports all of the
	  preferences described in this document and successfully
	  interoperates with the <xref target="caldavtester"
	  format="title"/> and <xref target="apple"
          format="title"/> client implementations described below. This
	  implementation is freely distributable under the terms of
	  the <eref
	  target="http://www.apache.org/licenses/LICENSE-2.0.html">Apache
	License, Version 2.0</eref>.</t>
      </section>

      <section title="Bedework" anchor="bedework" toc="exclude">

	<t><eref target="http://www.bedework.org/">Bedework</eref>
	  is an open-source enterprise calendar system that supports
	  public, personal, and group calendaring.  This production
	  level implementation supports the "return=minimal" preference
	  described in this document and successfully interoperates
	  with the <xref target="caldavtester" format="title"/> client
	  implementation described below.  This implementation is
	  freely distributable under the <eref
	  target="http://www.jasig.org/licensing">Jasig Licensing
	Policy</eref>.</t>
      </section>

      <section title="DAViCal" anchor="davical" toc="exclude">

	<t><eref target="http://www.davical.org/">DAViCal</eref>
	  is a server for calendar sharing using the CalDAV protocol.
	  This production level implementation supports the
	  "return=minimal" preference described in this document and
	  successfully interoperates with the <xref
	  target="caldavtester" format="title"/> client implementation
	  described below.  This implementation is <eref
	  target="http://www.gnu.org/philosophy/open-source-misses-the-point.html">Free
	  Software</eref> distributable under the <eref
	  target="http://www.gnu.org/licenses/gpl.html">General Public
	License</eref>.</t>
      </section>

      <section title="Apple Calendar and Apple Contacts"
	       anchor="apple" toc="exclude"> 

	<t>The widely used <eref
        target="http://www.apple.com/macos/">Apple Calendar and Apple
        Contacts</eref> clients are standards-compliant
	  clients implementing the CalDAV and CardDAV protocols
          respectively.  These production level implementations
          support the "return=minimal" preference described in this
          document and successfully interoperate with the <xref target="cyrus"
	  format="title"/> and <xref target="calendarserver"
          format="title"/> implementations described above. These
	  client implementations are proprietary and are distributed
          as part of Apple's desktop operating systems.</t>
      </section>

      <section title="aCal" anchor="acal" toc="exclude">

	<t><eref target="http://www.acal.me/">aCal</eref>
	is an open source calendar client for Android which uses the
	CalDAV standard for communication.  This implementation makes
	some use of each of the preferences described in this document
	and successfully interoperates with the <xref target="cyrus"
	format="title"/> server implementation described above.  This
	implementation is freely distributable under the <eref
	target="http://www.gnu.org/licenses/gpl.html">General Public
	License</eref>.</t>
      </section>

      <section title="CalDAVTester" anchor="caldavtester" toc="exclude">

	<t><eref target="http://calendarserver.org/wiki/CalDAVTester">
	  CalDAVTester</eref> is an open source test and performance
	  application designed to work with CalDAV and/or CardDAV
	  servers and tests various aspects of their protocol
	  handling as well as performance.  This widely used
	  implementation supports all of the preferences described in
	  this document and successfully interoperates with the server
	  implementations described above.  This implementation is
	  freely distributable under the terms of the <eref
	  target="http://www.apache.org/licenses/LICENSE-2.0.html">Apache
	  License, Version 2.0</eref>.</t>
      </section>

    </section>


    <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="RFC7240"/> and those
	already inherent in those methods.</t>

    </section>


    <section title="IANA Considerations">

      <section title="Preference Registration">

        <t>The following preference is to be added to the HTTP Preferences
        Registry defined in Section 5.1 of <xref target="RFC7240"/>.</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: RFCXXXX, <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="Method References">

        <t>The following methods are to have their references updated
        in the HTTP Method Registry defined in Section 8.1 of
        <xref target="RFC7231"/>.</t>

        <texttable>
          <ttcol>Method Name</ttcol>
          <ttcol>References</ttcol>
          <c>MKCALENDAR</c>
          <c>RFC4791, Section 5.3.1; RFCXXXX, <xref target="mkcol" /></c>
          <c>MKCOL</c>
          <c>RFC4918, Section 9.3; RFC 5689, Section 3;
          RFCXXXX, <xref target="mkcol" /></c> 
          <c>PROPFIND</c>
          <c>RFC4918, Section 9.1; RFCXXXX, <xref target="propfind" /></c>
          <c>PROPPATCH</c>
          <c>RFC4918, Section 9.2; RFCXXXX, <xref target="proppatch" /></c>
          <c>REPORT</c>
          <c>RFC3253, Section 3.6; RFCXXXX, <xref target="propfind" /></c>
        </texttable>

      </section>

    </section> <!-- IANA -->


    <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, Arnaud
      Quillaud, and Julian Reschke.</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;
      &rfc4791;
      &rfc4918;
      &rfc5689;
      &rfc5789;
      &rfc5995;
      &rfc7231;
      &rfc7232;
      &rfc7240;
    </references>

    <references title="Informative References">
      &rfc3744;
      &rfc6352;
      &rfc6578;
      &rfc6638;
      &rfc7942;

      <reference anchor="MSDN.aa563501"
		 target="http://msdn.microsoft.com/en-us/library/aa563501.aspx">
	<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"
		 target="http://msdn.microsoft.com/en-us/library/aa580336.aspx">
	<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"
		 target="http://msdn.microsoft.com/en-us/library/aa493854.aspx">
	<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"
		 target="http://msdn.microsoft.com/en-us/library/aa563950.aspx">
	<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>Client and server implementations that already support the
      Brief header field can add support for the "return=minimal"
      preference with nominal effort.</t>

      <t>If a server supporting the Prefer header field receives both
      the Brief and Prefer header fields in a request, clients can
      expect the server to ignore the Brief header field and only use
      the Prefer header field preferences.</t>
    </section> <!-- Brief -->

    
    <section title="Examples" anchor="examples">

      <section title="PROPFIND" anchor="propfind-examples">

        <section title="Typical PROPFIND request/response with
                        Depth:1" toc="exclude">

	  <t>This example tries to fetch one known and one unknown
          property from child resources.</t>

	  <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
Depth: 1

<?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:response>
    <D:href>/container/work/</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:response>
    <D:href>/container/home/</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:response>
    <D:href>/container/foo.txt</D:href>
    <D:propstat>
      <D:prop>
        <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="Minimal PROPFIND request/response with
                        Depth:1" toc="exclude"> 

	  <t>This example tries to fetch one known and one unknown
          property from child resources only.</t>

	  <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
Depth: 1
Prefer: return=minimal, depth-noroot

<?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
Preference-Applied: return=minimal, depth-noroot

<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:">
  <D:response>
    <D:href>/container/work/</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:response>
    <D:href>/container/home/</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:response>
    <D:href>/container/foo.txt</D:href>
    <D:propstat>
      <D:prop>
        <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="Minimal PROPFIND request/response
		        with an empty DAV:propstat element"
	         toc="exclude">

	  <t>This example tries to fetch an unknown property from
	  a collection.</t>

	  <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
Preference-Applied: return=minimal

<?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="REPORT" anchor="report-examples">
	<section title="Typical REPORT request/response"
		 toc="exclude">

	  <t>This example tries to fetch an unknown property from
	  several resources via the <xref
          target="RFC3253">DAV:expand-property</xref> REPORT type.</t>

	  <figure>
	    <preamble>&gt;&gt; Request &lt;&lt;</preamble>
	    <artwork><![CDATA[
REPORT /dav/principals/ HTTP/1.1
Host: webdav.example.com
Content-type: text/xml; charset=utf-8
Content-length: xxxx

<?xml version="1.0" encoding="utf-8"?>
<D:expand-property xmlns:D="DAV:">
  <D:property name="current-user-principal">
    <D:property name="resourcetype"/>
    <D:property name="displayname"/>
    <D:property name="foobar"
                namespace="http://ns.example.com/foobar"/>
    <D:property name="calendar-home-set"
                namespace="urn:ietf:params:xml:ns:caldav">
      <D:property name="resourcetype"/>
      <D:property name="foobar"
                  namespace="http://ns.example.com/foobar"/>
    </D:property>
    <D:property name="addressbook-home-set"
                namespace="urn:ietf:params:xml:ns:carddav">
      <D:property name="resourcetype"/>
      <D:property name="foobar"
                  namespace="http://ns.example.com/foobar"/>
    </D:property>
  </D:property>
</D:expand-property>
]]></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:C="urn:ietf:params:xml:ns:caldav"
               xmlns:R="urn:ietf:params:xml:ns:carddav"
               xmlns:X="http://ns.example.com/foobar">
  <D:response>
    <D:href>/dav/principals/</D:href>
    <D:propstat>
      <D:prop>
        <D:current-user-principal>
          <D:response>
            <D:href>/dav/principals/user/ken/</D:href>
            <D:propstat>
              <D:prop>
                <D:resourcetype>
                  <D:principal/>
                </D:resourcetype>
                <D:displayname>ken</D:displayname>
                <C:calendar-home-set>
                  <D:response>
                    <D:href>/dav/calendars/user/ken/</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>
                </C:calendar-home-set>
                <R:addressbook-home-set>
                  <D:response>
                    <D:href>/dav/addressbooks/user/ken/</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>
                </R:addressbook-home-set>
              </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:current-user-principal>
      </D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>
</D:multistatus>
]]></artwork>
	  </figure>

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

	<section title="Minimal REPORT request/response"
		 toc="exclude">

	  <t>This example tries to fetch an unknown property from
	  several resources via the <xref
          target="RFC3253">DAV:expand-property</xref> REPORT type.</t>

	  <figure>
	    <preamble>&gt;&gt; Request &lt;&lt;</preamble>
	    <artwork><![CDATA[
REPORT /dav/principals/ 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:expand-property xmlns:D="DAV:">
  <D:property name="current-user-principal">
    <D:property name="resourcetype"/>
    <D:property name="displayname"/>
    <D:property name="foobar"
                namespace="http://ns.example.com/foobar"/>
    <D:property name="calendar-home-set"
                namespace="urn:ietf:params:xml:ns:caldav">
      <D:property name="resourcetype"/>
      <D:property name="foobar"
                  namespace="http://ns.example.com/foobar"/>
    </D:property>
    <D:property name="addressbook-home-set"
                namespace="urn:ietf:params:xml:ns:carddav">
      <D:property name="resourcetype"/>
      <D:property name="foobar"
                  namespace="http://ns.example.com/foobar"/>
    </D:property>
  </D:property>
</D:expand-property>
]]></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
Preference-Applied: return=minimal

<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:"
               xmlns:C="urn:ietf:params:xml:ns:caldav"
               xmlns:R="urn:ietf:params:xml:ns:carddav"
               xmlns:X="http://ns.example.com/foobar">
  <D:response>
    <D:href>/dav/principals/</D:href>
    <D:propstat>
      <D:prop>
        <D:current-user-principal>
          <D:response>
            <D:href>/dav/principals/user/ken/</D:href>
            <D:propstat>
              <D:prop>
                <D:resourcetype>
                  <D:principal/>
                </D:resourcetype>
                <D:displayname>ken</D:displayname>
                <C:calendar-home-set>
                  <D:response>
                    <D:href>/dav/calendars/user/ken/</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>
                </C:calendar-home-set>
                <R:addressbook-home-set>
                  <D:response>
                    <D:href>/dav/addressbooks/user/ken/</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>
                </R:addressbook-home-set>
              </D:prop>
              <D:status>HTTP/1.1 200 OK</D:status>
            </D:propstat>
          </D:response>
        </D:current-user-principal>
      </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="PROPPATCH" anchor="proppatch-examples">
	<section title="Typical PROPPATCH request/response"
		 toc="exclude">
	  <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="Minimal PROPPATCH request/response"
		 toc="exclude">
	  <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
Preference-Applied: return=minimal

]]></artwork>
	  </figure>

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

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

      
      <section title="MKCOL" anchor="mkcol-examples">
	<section title="Verbose MKCOL request/response"
		 toc="exclude">
	  <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="Minimal MKCOL request/response"
		 toc="exclude">
	  <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
Preference-Applied: return=minimal

]]></artwork>
	  </figure>
	</section> <!-- MKCOL example w/ Prefer -->

      </section> <!-- MKCOL -->

      
      <section title="POST" anchor="post-examples">
        <section title="Typical resource creation and retrieval
		        via POST + GET"
	         toc="exclude">

	  <t>Note that this request is not conditional because by using
	  the <xref target="RFC5995">POST</xref> method the client lets
	  the server choose the resource URI, thereby guaranteeing that it will
	  not modify an existing resource.</t>

	  <figure>
	    <preamble>&gt;&gt; Request &lt;&lt;</preamble>
	    <artwork><![CDATA[
POST /container/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: /container/work/abc.ics
Content-Length: 0

]]></artwork>
	    <postamble>Note that the server did not include any
	    validator header fields (e.g ETag) in the response,
	    signaling that the created representation differs from
	    the representation sent in the body of the request.  The
	    client has to send a separate GET request to retrieve the
	    current representation:</postamble>
	  </figure>

	  <figure>
	    <preamble>&gt;&gt; Request &lt;&lt;</preamble>
	    <artwork><![CDATA[
GET /container/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="Streamlined resource creation and
		        retrieval via POST"
	         toc="exclude">

	  <t>Note that this request is not conditional because by using
	  the <xref target="RFC5995">POST</xref> method the client lets
	  the server choose the resource URI, thereby guaranteeing that it will
	  not modify an existing resource.</t>

	  <figure>
	    <preamble>&gt;&gt; Request &lt;&lt;</preamble>
	    <artwork><![CDATA[
POST /container/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: /container/work/abc.ics
Content-Type: text/calendar; charset=utf-8
Content-Length: xxxx
Content-Location: /container/work/abc.ics
ETag: "nahduyejc"
Schedule-Tag: "jfd84hgbcn"
Preference-Applied: return=representation

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> <!-- POST -->


      <section title="PUT" anchor="put-examples">

        <section title="Typical conditional resource update
		        failure and retrieval via PUT + GET"
	         toc="exclude">

	  <figure>
	    <preamble>&gt;&gt; Request &lt;&lt;</preamble>
	    <artwork><![CDATA[
PUT /container/motd.txt HTTP/1.1
Host: dav.example.com
Content-Type: text/plain
Content-Length: xxxx
If-Match: "asd973"

Either write something worth reading or do something worth writing.
]]></artwork>
	  </figure>

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

]]></artwork>
	    <postamble>The resource has been modified by another user
	    agent (ETag mismatch), therefore the client has to send a
	    separate GET request to retrieve the current
	    representation:</postamble>
	  </figure>

	  <figure>
	    <preamble>&gt;&gt; Request &lt;&lt;</preamble>
	    <artwork><![CDATA[
GET /container/motd.txt HTTP/1.1
Host: dav.example.com

]]></artwork>
	  </figure>

	  <figure>
	    <preamble>&gt;&gt; Response &lt;&lt;</preamble>
	    <artwork><![CDATA[
HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: xxxx
ETag: "789sdas"

An investment in knowledge pays the best interest.
]]></artwork>
	  </figure>

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

        <section title="Streamlined conditional resource update
		        failure and retrieval via PUT"
	         toc="exclude">

	  <figure>
	    <preamble>&gt;&gt; Request &lt;&lt;</preamble>
	    <artwork><![CDATA[
PUT /container/motd.txt HTTP/1.1
Host: dav.example.com
Content-Type: text/plain
Content-Length: xxxx
If-Match: "asd973"
Prefer: return=representation

Either write something worth reading or do something worth writing.
]]></artwork>
	  </figure>

	  <figure>
	    <preamble>&gt;&gt; Response &lt;&lt;</preamble>
	    <artwork><![CDATA[
HTTP/1.1 412 Precondition Failed
Content-Type: text/plain
Content-Length: xxxx
Content-Location: /container/motd.txt
ETag: "789sdas"
Preference-Applied: return=representation

An investment in knowledge pays the best interest.
]]></artwork>
	  </figure>

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

      </section> <!-- PUT -->

    </section> <!-- Examples -->

    
    <section title="Change Log">

      <t>&lt; RFC Editor: before publication please remove this
      section &gt;</t>

      <section title="Since -09" toc="exclude">
	<t><list style="symbols">
	  <t>Combined PROPFIND and REPORT sections</t>

          <t>Added several more RFCs to Updated list.</t>

          <t>Added list of report types that can benefit from
          "return=minimal".</t>

          <t>Changed REPORT example to use DAV:expand-property.</t>

          <t>Added IANA section to update HTTP Method Registry
          references.</t>

          <t>Split "return=representation" discussion into two separate
          sections and expanded text.</t>

          <t>Updated Open Issues with new questions.</t>

	  <t>Several editorial changes from Julian Reschke.</t>
	</list></t>
      </section>

      <section title="Since -08" toc="exclude">
	<t><list style="symbols">
	  <t>Moved examples to Appendix B.</t>

          <t>Added reference to HTTP PATCH.</t>

	  <t>Updated Implementation Status reference from RFC 6982 to
          RFC 7942.</t>
	</list></t>
      </section>

      <section title="Since -07" toc="exclude">
	<t><list style="symbols">
	  <t>No substantive changes.  Refreshed due to pending expiration.</t>
	</list></t>
      </section>

      <section title="Since -06" toc="exclude">
	<t><list style="symbols">
	  <t>Updated HTTPbis and Prefer references to published RFCs.</t>
	</list></t>
      </section>

      <section title="Since -05" toc="exclude">
	<t><list style="symbols">
	  <t>Allow a minimal PROPFIND/REPORT response to contain a
	  DAV:status element rather than an empty DAV:propstat
	  element.</t>

	  <t>Allow 204 (No Content) as a minimal PROPATCH success
	  response.</t>

	  <t>Added justification for why a minimal MKCOL/MKCALENDAR
	  success response must have an empty body.</t>

	  <t>Added text and an example of how "return=representation"
	  can be employed with a conditional state-changing request
	  and a 412 (Precondition Failed) response.</t>

	  <t>Added a note to the POST+GET example bringing attention
	  to the lack of a validator header field in the POST
	  response.</t>

	  <t>Reduced the number of inline references.</t>

	  <t>Limited most examples to vanilla WebDAV.</t>

	  <t>Reduced number of items in TOC.</t>

	  <t>Removed the recommendation that the legacy Brief header
	  functionality should be implemented.</t>

	  <t>Added note about how a server should handle a request
	  that contains both Brief and Prefer.</t>

	  <t>Other editorial tweaks from Julian Reschke.</t>
	</list></t>
      </section>

      <section title="Since -04" toc="exclude">
	<t><list style="symbols">
	  <t>Added note stating where to send comments.</t>
	</list></t>
      </section>

      <section title="Since -03" toc="exclude">
	<t><list style="symbols">
	    <t>Limited "Updates" to just RFC 4918.</t>
	  
	    <t>Consensus from CalConnect membership that a
	    "depth-root" option is unnecessary at this point.</t>

	    <t>Consensus from CalConnect membership to remove Vary
	    header field from PROPFIND and REPORT responses since
	    these responses don't appear to be cached.</t> 

	    <t>Updated "Implementation Status" section boilerplate to
	    RFC 6982.</t>

	    <t>Added aCal to "Implementation Status" section.</t>

	    <t>Added note that servers SHOULD respond with
	    Preference-Applied when return=minimal is used with
	    PROPFIND or REPORT.</t>
	</list></t>
      </section>

      <section title="Since -02" toc="exclude">
	<t><list style="symbols">
	    <t>Reintroduced "Updates" to header.</t>

	    <t>Added text noting that "return=representation" provides
	    a level of atomicity to the operation.</t>

	    <t>Added "Implementation Status" section.</t>

	    <t>Tweaked/corrected some examples..</t>

	    <t>Updated HTTPbis references.</t>
	</list></t>
      </section>

      <section title="Since -01" toc="exclude">
	<t><list style="symbols">
	    <t>Removed "Updates" from header.</t>

	    <t>Fixed some missing/incorrect references.</t>

	    <t>Reintroduced Cache-Control:no-cache to MKCOL responses.</t>
	</list></t>
      </section>

      <section title="Since -00" toc="exclude">
	<t><list style="symbols">
	    <t>Updated to comply with draft-snell-httpprefer-18.</t>
	    <t>Reordered "Minimal REPORT Response" and "Minimal
	      PROPPATCH Response" sections.</t>
	    <t>Added some explanatory text to examples.</t>
	</list></t>
      </section>

      <section title="Since CalConnect XXIV" toc="exclude">
	<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> 
