7Network Working Group C. Daboo
8Request for Comments: 5689 Apple Inc.
9Updates: 4791, 4918 September 2009
10Category: Standards Track
13 Extended MKCOL for Web Distributed Authoring and Versioning (WebDAV)
17 This specification extends the Web Distributed Authoring and
18 Versioning (WebDAV) MKCOL (Make Collection) method to allow
19 collections of arbitrary resourcetype to be created and to allow
20 properties to be set at the same time.
24 This document specifies an Internet standards track protocol for the
25 Internet community, and requests discussion and suggestions for
26 improvements. Please refer to the current edition of the "Internet
27 Official Protocol Standards" (STD 1) for the standardization state
28 and status of this protocol. Distribution of this memo is unlimited.
32 Copyright (c) 2009 IETF Trust and the persons identified as the
33 document authors. All rights reserved.
35 This document is subject to BCP 78 and the IETF Trust's Legal
36 Provisions Relating to IETF Documents
37 (http://trustee.ietf.org/license-info) in effect on the date of
38 publication of this document. Please review these documents
39 carefully, as they describe your rights and restrictions with respect
40 to this document. Code Components extracted from this document must
41 include Simplified BSD License text as described in Section 4.e of
42 the Trust Legal Provisions and are provided without warranty as
43 described in the BSD License.
45 This document may contain material from IETF Documents or IETF
46 Contributions published or made publicly available before November
47 10, 2008. The person(s) controlling the copyright in some of this
48 material may not have granted the IETF Trust the right to allow
49 modifications of such material outside the IETF Standards Process.
50 Without obtaining an adequate license from the person(s) controlling
51 the copyright in such materials, this document may not be modified
52 outside the IETF Standards Process, and derivative works of it may
58Daboo Standards Track [Page 1]
60RFC 5689 Extended MKCOL for WebDAV September 2009
63 not be created outside the IETF Standards Process, except to format
64 it for publication as an RFC or to translate it into languages other
69 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
70 2. Conventions Used in This Document . . . . . . . . . . . . . . 3
71 3. WebDAV Extended MKCOL . . . . . . . . . . . . . . . . . . . . 4
72 3.1. Extended MKCOL Support . . . . . . . . . . . . . . . . . . 5
73 3.1.1. Example: Using OPTIONS for the Discovery of
74 Support for Extended MKCOL . . . . . . . . . . . . . . 5
75 3.2. Status Codes . . . . . . . . . . . . . . . . . . . . . . . 5
76 3.3. Additional Precondition for Extended MKCOL . . . . . . . . 5
77 3.4. Example: Successful Extended MKCOL Request . . . . . . . . 6
78 3.5. Example: Unsuccessful Extended MKCOL Request . . . . . . . 6
79 4. Using Extended MKCOL as an Alternative for MKxxx Methods . . . 8
80 4.1. MKCALENDAR Alternative . . . . . . . . . . . . . . . . . . 8
81 4.1.1. Example: Using MKCOL Instead of MKCALENDAR . . . . . . 8
82 5. XML Element Definitions . . . . . . . . . . . . . . . . . . . 10
83 5.1. mkcol XML Element . . . . . . . . . . . . . . . . . . . . 10
84 5.2. mkcol-response XML Element . . . . . . . . . . . . . . . . 10
85 6. Security Considerations . . . . . . . . . . . . . . . . . . . 11
86 7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 11
87 8. Normative References . . . . . . . . . . . . . . . . . . . . . 11
114Daboo Standards Track [Page 2]
116RFC 5689 Extended MKCOL for WebDAV September 2009
121 WebDAV [RFC4918] defines the HTTP [RFC2616] method MKCOL. This
122 method is used to create WebDAV collections on the server. However,
123 several WebDAV-based specifications (e.g., CalDAV [RFC4791]) define
124 "special" collections -- ones that are identified by additional
125 values in the DAV:resourcetype property assigned to the collection
126 resource or by other means. These "special" collections are created
127 by new methods (e.g., MKCALENDAR). The addition of a new MKxxx
128 method for each new "special" collection adds to server complexity
129 and is detrimental to overall reliability due to the need to make
130 sure intermediaries are aware of these methods.
132 This specification defines an extension to the WebDAV MKCOL method
133 that adds a request body allowing a client to specify WebDAV
134 properties to be set on the newly created collection or resource. In
135 particular, the DAV:resourcetype property can be used to create a
136 "special" collection; alternatively, other properties can be used to
137 create a "special" resource. This avoids the need to invent new
1402. Conventions Used in This Document
142 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
143 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
144 document are to be interpreted as described in [RFC2119].
146 This document uses XML DTD fragments (Section 3.2 of
147 [W3C.REC-xml-20081126]) as a purely notational convention. WebDAV
148 request and response bodies cannot be validated by a DTD due to the
149 specific extensibility rules defined in Section 17 of [RFC4918] and
150 due to the fact that all XML elements defined by this specification
151 use the XML namespace name "DAV:". In particular:
153 1. Element names use the "DAV:" namespace.
155 2. Element ordering is irrelevant unless explicitly stated.
157 3. Extension elements (elements not already defined as valid child
158 elements) may be added anywhere, except when explicitly stated
161 4. Extension attributes (attributes not already defined as valid for
162 this element) may be added anywhere, except when explicitly
170Daboo Standards Track [Page 3]
172RFC 5689 Extended MKCOL for WebDAV September 2009
175 When an XML element type in the "DAV:" namespace is referenced in
176 this document outside of the context of an XML fragment, the string
177 "DAV:" will be prefixed to the element type.
179 This document inherits, and sometimes extends, DTD productions from
180 Section 14 of [RFC4918].
1823. WebDAV Extended MKCOL
184 The WebDAV MKCOL request is extended to allow the inclusion of a
185 request body. The request body is an XML document containing a
186 single DAV:mkcol XML element as the root element. The Content-Type
187 request header MUST be set appropriately for an XML body (e.g., set
188 to "text/xml" or "application/xml"). XML-typed bodies for an MKCOL
189 request that do not have DAV:mkcol as the root element are reserved
192 One or more DAV:set XML elements may be included in the DAV:mkcol XML
193 element to allow setting properties on the collection as it is
194 created. In particular, to create a collection of a particular type,
195 the DAV:resourcetype XML element MUST be included in a DAV:set XML
196 element and MUST specify the expected resource type elements for the
197 new resource, which MUST include the DAV:collection element that
198 needs to be present for any WebDAV collection.
200 As per the PROPPATCH method (Section 9.2 of [RFC4918]), servers MUST
201 process any DAV:set instructions in document order (an exception to
202 the normal rule that ordering is irrelevant). If any one instruction
203 fails to execute successfully, all instructions MUST fail (i.e.,
204 either all succeed or all fail). Thus, if any error occurs during
205 processing, all executed instructions MUST be undone and a proper
206 error result returned. Failure to set a property value on the
207 collection MUST result in a failure of the overall MKCOL request --
208 i.e., the collection is not created.
210 The response to an extended MKCOL request MUST be an XML document
211 containing a single DAV:mkcol-response XML element, which MUST
212 contain DAV:propstat XML elements with the status of each property
213 when the request fails due to a failure to set one or more of the
214 properties specified in the request body. The server MAY return a
215 response body in the case where the request is successful, indicating
216 success for setting each property specified in the request body.
217 When an empty response body is returned with a success request status
218 code, the client can assume that all properties were set.
220 In all other respects, the behavior of the extended MKCOL request
221 follows that of the standard MKCOL request.
226Daboo Standards Track [Page 4]
228RFC 5689 Extended MKCOL for WebDAV September 2009
2313.1. Extended MKCOL Support
233 A server supporting the features described in this document MUST
234 include "extended-mkcol" as a field in the DAV response header from
235 an OPTIONS request on any URI that supports use of the extended MKCOL
2383.1.1. Example: Using OPTIONS for the Discovery of Support for Extended
243 OPTIONS /addressbooks/users/ HTTP/1.1
244 Host: addressbook.example.com
249 Allow: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE
250 Allow: MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, REPORT, ACL
251 DAV: 1, 2, 3, access-control, extended-mkcol
252 Date: Sat, 11 Nov 2006 09:32:12 GMT
257 As per Section 9.3.1 of [RFC4918].
2593.3. Additional Precondition for Extended MKCOL
261 WebDAV ([RFC4918], Section 16) defines preconditions and
262 postconditions for request behavior. This specification adds the
263 following precondition for the extended MKCOL request.
265 Name: valid-resourcetype
269 Use with: Typically 403 (Forbidden)
271 Purpose: (precondition) -- The server MUST support the specified
272 resourcetype value for the specified collection.
282Daboo Standards Track [Page 5]
284RFC 5689 Extended MKCOL for WebDAV September 2009
2873.4. Example: Successful Extended MKCOL Request
289 This example shows how the extended MKCOL request is used to create a
290 collection of a fictitious type "special-resource". The response
291 body is empty as the request completed successfully.
295 MKCOL /home/special/ HTTP/1.1
296 Host: special.example.com
297 Content-Type: application/xml; charset="utf-8"
300 <?xml version="1.0" encoding="utf-8" ?>
301 <D:mkcol xmlns:D="DAV:"
302 xmlns:E="http://example.com/ns/">
307 <E:special-resource/>
309 <D:displayname>Special Resource</D:displayname>
317 Cache-Control: no-cache
318 Date: Sat, 11 Nov 2006 09:32:12 GMT
3203.5. Example: Unsuccessful Extended MKCOL Request
322 This example shows an attempt to use the extended MKCOL request to
323 create a collection of a fictitious type "special-resource", which is
324 not actually supported by the server. The response body shows that
325 an error occurred specifically with the DAV:resourcetype property.
338Daboo Standards Track [Page 6]
340RFC 5689 Extended MKCOL for WebDAV September 2009
345 MKCOL /home/special/ HTTP/1.1
346 Host: special.example.com
347 Content-Type: application/xml; charset="utf-8"
350 <?xml version="1.0" encoding="utf-8" ?>
351 <D:mkcol xmlns:D="DAV:"
352 xmlns:E="http://example.com/ns/">
357 <E:special-resource/>
359 <D:displayname>Special Resource</D:displayname>
366 HTTP/1.1 403 Forbidden
367 Cache-Control: no-cache
368 Date: Sat, 11 Nov 2006 09:32:12 GMT
369 Content-Type: application/xml; charset="utf-8"
372 <?xml version="1.0" encoding="utf-8" ?>
373 <D:mkcol-response xmlns:D="DAV:">
378 <D:status>HTTP/1.1 403 Forbidden</D:status>
379 <D:error><D:valid-resourcetype /></D:error>
380 <D:responsedescription>Resource type is not
381 supported by this server</D:responsedescription>
387 <D:status>HTTP/1.1 424 Failed Dependency</D:status>
394Daboo Standards Track [Page 7]
396RFC 5689 Extended MKCOL for WebDAV September 2009
3994. Using Extended MKCOL as an Alternative for MKxxx Methods
401 One of the goals of this extension is to eliminate the need for other
402 extensions to define their own variant of MKCOL to create the special
403 collections they need. This extension can be used as an alternative
404 to existing MKxxx methods in other extensions as detailed below. If
405 a server supports this extension and the other extension listed, then
406 the server MUST support use of the extended MKCOL method to achieve
407 the same result as the MKxxx method of the other extension.
4094.1. MKCALENDAR Alternative
411 CalDAV defines the MKCALENDAR method to create a calendar collection
412 as well as to set properties during creation (Section 5.3.1 of
415 The extended MKCOL method can be used instead by specifying both DAV:
416 collection and CALDAV:calendar-collection XML elements in the DAV:
417 resourcetype property, set during the extended MKCOL request.
4194.1.1. Example: Using MKCOL Instead of MKCALENDAR
421 The first example below shows an MKCALENDAR request containing a
422 CALDAV:mkcalendar XML element in the request body and returning a
423 CALDAV:mkcalendar-response XML element in the response body.
425 >> MKCALENDAR Request <<
427 MKCALENDAR /home/lisa/calendars/events/ HTTP/1.1
428 Host: calendar.example.com
429 Content-Type: application/xml; charset="utf-8"
432 <?xml version="1.0" encoding="utf-8" ?>
433 <C:mkcalendar xmlns:D="DAV:"
434 xmlns:C="urn:ietf:params:xml:ns:caldav">
437 <D:displayname>Lisa's Events</D:displayname>
450Daboo Standards Track [Page 8]
452RFC 5689 Extended MKCOL for WebDAV September 2009
455 >> MKCALENDAR Response <<
458 Cache-Control: no-cache
459 Date: Sat, 11 Nov 2006 09:32:12 GMT
460 Content-Type: application/xml; charset="utf-8"
463 <?xml version="1.0" encoding="utf-8" ?>
464 <C:mkcalendar-response xmlns:D="DAV:"
465 xmlns:C="urn:ietf:params:xml:ns:caldav">
470 <D:status>HTTP/1.1 200 OK</D:status>
472 </C:mkcalendar-response>
474 The second example shows the equivalent extended MKCOL request with
475 the same request and response XML elements.
479 MKCOL /home/lisa/calendars/events/ HTTP/1.1
480 Host: calendar.example.com
481 Content-Type: application/xml; charset="utf-8"
484 <?xml version="1.0" encoding="utf-8" ?>
485 <D:mkcol xmlns:D="DAV:"
486 xmlns:C="urn:ietf:params:xml:ns:caldav">
493 <D:displayname>Lisa's Events</D:displayname>
506Daboo Standards Track [Page 9]
508RFC 5689 Extended MKCOL for WebDAV September 2009
514 Cache-Control: no-cache
515 Date: Sat, 11 Nov 2006 09:32:12 GMT
516 Content-Type: application/xml; charset="utf-8"
519 <?xml version="1.0" encoding="utf-8" ?>
520 <D:mkcol-response xmlns:D="DAV:"
521 xmlns:C="urn:ietf:params:xml:ns:caldav">
527 <D:status>HTTP/1.1 200 OK</D:status>
5315. XML Element Definitions
5335.1. mkcol XML Element
539 Purpose: Used in a request to specify properties to be set in an
540 extended MKCOL request, as well as any additional information
541 needed when creating the resource.
543 Description: This XML element is a container for the information
544 required to modify the properties on a collection resource as it
545 is created in an extended MKCOL request.
549 <!ELEMENT mkcol (set+)>
5515.2. mkcol-response XML Element
562Daboo Standards Track [Page 10]
564RFC 5689 Extended MKCOL for WebDAV September 2009
567 Purpose: Used in a response to indicate the status of properties
568 that were set or failed to be set during an extended MKCOL
571 Description: This XML element is a container for the information
572 returned about a resource that has been created in an extended
577 <!ELEMENT mkcol-response (propstat+)>
5796. Security Considerations
581 This extension does not introduce any new security concerns beyond
582 those already described in HTTP [RFC2616] and WebDAV [RFC4918].
586 Thanks to Bernard Desruisseaux, Mike Douglass, Alexey Melnikov,
587 Julian Reschke, and Simon Vaillancourt.
5908. Normative References
592 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
593 Requirement Levels", BCP 14, RFC 2119, March 1997.
595 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
596 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext
597 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
599 [RFC4791] Daboo, C., Desruisseaux, B., and L. Dusseault,
600 "Calendaring Extensions to WebDAV (CalDAV)", RFC 4791,
603 [RFC4918] Dusseault, L., "HTTP Extensions for Web Distributed
604 Authoring and Versioning (WebDAV)", RFC 4918, June 2007.
606 [W3C.REC-xml-20081126]
607 Maler, E., Yergeau, F., Paoli, J., Bray, T., and C.
608 Sperberg-McQueen, "Extensible Markup Language (XML) 1.0
609 (Fifth Edition)", World Wide Web Consortium
610 Recommendation REC-xml-20081126, November 2008,
611 <http://www.w3.org/TR/2008/REC-xml-20081126>.
618Daboo Standards Track [Page 11]
620RFC 5689 Extended MKCOL for WebDAV September 2009
631 EMail: cyrus@daboo.name
632 URI: http://www.apple.com/
674Daboo Standards Track [Page 12]