Network Working Group                                           C. Daboo
Request for Comments: 5689                                    Apple Inc.
Updates: 4791, 4918                                       September 2009
Category: Standards Track
        
Network Working Group                                           C. Daboo
Request for Comments: 5689                                    Apple Inc.
Updates: 4791, 4918                                       September 2009
Category: Standards Track
        

Extended MKCOL for Web Distributed Authoring and Versioning (WebDAV)

用于Web分布式创作和版本控制的扩展MKCOL(WebDAV)

Abstract

摘要

This specification extends the Web Distributed Authoring and Versioning (WebDAV) MKCOL (Make Collection) method to allow collections of arbitrary resourcetype to be created and to allow properties to be set at the same time.

本规范扩展了Web分布式创作和版本控制(WebDAV)MKCOL(生成集合)方法,以允许创建任意资源类型的集合,并允许同时设置属性。

Status of This Memo

关于下段备忘

This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited.

本文件规定了互联网社区的互联网标准跟踪协议,并要求进行讨论和提出改进建议。有关本协议的标准化状态和状态,请参考当前版本的“互联网官方协议标准”(STD 1)。本备忘录的分发不受限制。

Copyright Notice

版权公告

Copyright (c) 2009 IETF Trust and the persons identified as the document authors. All rights reserved.

版权所有(c)2009 IETF信托基金和确定为文件作者的人员。版权所有。

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the BSD License.

本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(http://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。从本文件中提取的代码组件必须包括《信托法律条款》第4.e节中所述的简化BSD许可文本,并且提供BSD许可中所述的代码组件时不提供任何担保。

This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may

本文件可能包含2008年11月10日之前发布或公开的IETF文件或IETF贡献中的材料。控制某些材料版权的人员可能未授予IETF信托允许在IETF标准流程之外修改此类材料的权利。在未从控制此类材料版权的人员处获得充分许可的情况下,不得在IETF标准流程之外修改本文件,其衍生作品可能会

not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English.

不得在IETF标准流程之外创建,除非将其格式化以RFC形式发布,或将其翻译成英语以外的语言。

Table of Contents

目录

   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  3
   2.  Conventions Used in This Document  . . . . . . . . . . . . . .  3
   3.  WebDAV Extended MKCOL  . . . . . . . . . . . . . . . . . . . .  4
     3.1.  Extended MKCOL Support . . . . . . . . . . . . . . . . . .  5
       3.1.1.  Example: Using OPTIONS for the Discovery of
               Support for Extended MKCOL . . . . . . . . . . . . . .  5
     3.2.  Status Codes . . . . . . . . . . . . . . . . . . . . . . .  5
     3.3.  Additional Precondition for Extended MKCOL . . . . . . . .  5
     3.4.  Example: Successful Extended MKCOL Request . . . . . . . .  6
     3.5.  Example: Unsuccessful Extended MKCOL Request . . . . . . .  6
   4.  Using Extended MKCOL as an Alternative for MKxxx Methods . . .  8
     4.1.  MKCALENDAR Alternative . . . . . . . . . . . . . . . . . .  8
       4.1.1.  Example: Using MKCOL Instead of MKCALENDAR . . . . . .  8
   5.  XML Element Definitions  . . . . . . . . . . . . . . . . . . . 10
     5.1.  mkcol XML Element  . . . . . . . . . . . . . . . . . . . . 10
     5.2.  mkcol-response XML Element . . . . . . . . . . . . . . . . 10
   6.  Security Considerations  . . . . . . . . . . . . . . . . . . . 11
   7.  Acknowledgments  . . . . . . . . . . . . . . . . . . . . . . . 11
   8.  Normative References . . . . . . . . . . . . . . . . . . . . . 11
        
   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  3
   2.  Conventions Used in This Document  . . . . . . . . . . . . . .  3
   3.  WebDAV Extended MKCOL  . . . . . . . . . . . . . . . . . . . .  4
     3.1.  Extended MKCOL Support . . . . . . . . . . . . . . . . . .  5
       3.1.1.  Example: Using OPTIONS for the Discovery of
               Support for Extended MKCOL . . . . . . . . . . . . . .  5
     3.2.  Status Codes . . . . . . . . . . . . . . . . . . . . . . .  5
     3.3.  Additional Precondition for Extended MKCOL . . . . . . . .  5
     3.4.  Example: Successful Extended MKCOL Request . . . . . . . .  6
     3.5.  Example: Unsuccessful Extended MKCOL Request . . . . . . .  6
   4.  Using Extended MKCOL as an Alternative for MKxxx Methods . . .  8
     4.1.  MKCALENDAR Alternative . . . . . . . . . . . . . . . . . .  8
       4.1.1.  Example: Using MKCOL Instead of MKCALENDAR . . . . . .  8
   5.  XML Element Definitions  . . . . . . . . . . . . . . . . . . . 10
     5.1.  mkcol XML Element  . . . . . . . . . . . . . . . . . . . . 10
     5.2.  mkcol-response XML Element . . . . . . . . . . . . . . . . 10
   6.  Security Considerations  . . . . . . . . . . . . . . . . . . . 11
   7.  Acknowledgments  . . . . . . . . . . . . . . . . . . . . . . . 11
   8.  Normative References . . . . . . . . . . . . . . . . . . . . . 11
        
1. Introduction
1. 介绍

WebDAV [RFC4918] defines the HTTP [RFC2616] method MKCOL. This method is used to create WebDAV collections on the server. However, several WebDAV-based specifications (e.g., CalDAV [RFC4791]) define "special" collections -- ones that are identified by additional values in the DAV:resourcetype property assigned to the collection resource or by other means. These "special" collections are created by new methods (e.g., MKCALENDAR). The addition of a new MKxxx method for each new "special" collection adds to server complexity and is detrimental to overall reliability due to the need to make sure intermediaries are aware of these methods.

WebDAV[RFC4918]定义了HTTP[RFC2616]方法MKCOL。此方法用于在服务器上创建WebDAV集合。但是,一些基于WebDAV的规范(例如,CalDAV[RFC4791])定义了“特殊”集合——由分配给集合资源的DAV:resourcetype属性中的附加值或通过其他方式标识的集合。这些“特殊”集合是通过新方法(如MKCALENDAR)创建的。为每个新的“特殊”集合添加一个新的MKxxx方法会增加服务器的复杂性,并且由于需要确保中介机构知道这些方法,因此不利于整体可靠性。

This specification defines an extension to the WebDAV MKCOL method that adds a request body allowing a client to specify WebDAV properties to be set on the newly created collection or resource. In particular, the DAV:resourcetype property can be used to create a "special" collection; alternatively, other properties can be used to create a "special" resource. This avoids the need to invent new MKxxx methods.

此规范定义了WebDAV MKCOL方法的扩展,该扩展添加了一个请求主体,允许客户端指定要在新创建的集合或资源上设置的WebDAV属性。特别是,DAV:resourcetype属性可用于创建“特殊”集合;或者,可以使用其他属性创建“特殊”资源。这避免了发明新的MKxxx方法的需要。

2. Conventions Used in This Document
2. 本文件中使用的公约

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 [RFC2119].

本文件中的关键词“必须”、“不得”、“必需”、“应”、“不应”、“应”、“不应”、“建议”、“可”和“可选”应按照[RFC2119]中所述进行解释。

This document uses XML DTD fragments (Section 3.2 of [W3C.REC-xml-20081126]) as a purely notational convention. WebDAV request and response bodies cannot be validated by a DTD due to the specific extensibility rules defined in Section 17 of [RFC4918] and due to the fact that all XML elements defined by this specification use the XML namespace name "DAV:". In particular:

本文档使用XML DTD片段(W3C.REC-XML-20081126的第3.2节)作为纯粹的符号约定。由于[RFC4918]第17节中定义的特定扩展性规则以及本规范定义的所有XML元素都使用XML命名空间名称“DAV:”,DTD无法验证WebDAV请求和响应主体。特别地:

1. Element names use the "DAV:" namespace.

1. 元素名称使用“DAV:”名称空间。

2. Element ordering is irrelevant unless explicitly stated.

2. 除非明确说明,否则元素顺序是不相关的。

3. Extension elements (elements not already defined as valid child elements) may be added anywhere, except when explicitly stated otherwise.

3. 扩展元素(尚未定义为有效子元素的元素)可以添加到任何位置,除非另有明确说明。

4. Extension attributes (attributes not already defined as valid for this element) may be added anywhere, except when explicitly stated otherwise.

4. 扩展属性(尚未定义为此元素有效的属性)可以添加到任何位置,除非另有明确说明。

When an XML element type in the "DAV:" namespace is referenced in this document outside of the context of an XML fragment, the string "DAV:" will be prefixed to the element type.

当“DAV:”命名空间中的XML元素类型在XML片段上下文之外的文档中被引用时,字符串“DAV:”将作为元素类型的前缀。

This document inherits, and sometimes extends, DTD productions from Section 14 of [RFC4918].

本文档继承并有时扩展[RFC4918]第14节中的DTD产品。

3. WebDAV Extended MKCOL
3. WebDAV扩展MKCOL

The WebDAV MKCOL request is extended to allow the inclusion of a request body. The request body is an XML document containing a single DAV:mkcol XML element as the root element. The Content-Type request header MUST be set appropriately for an XML body (e.g., set to "text/xml" or "application/xml"). XML-typed bodies for an MKCOL request that do not have DAV:mkcol as the root element are reserved for future usage.

WebDAV MKCOL请求被扩展以允许包含请求主体。请求主体是一个XML文档,包含一个DAV:mkcol XML元素作为根元素。必须为XML主体适当设置内容类型请求头(例如,设置为“text/XML”或“application/XML”)。对于没有DAV:MKCOL作为根元素的MKCOL请求,保留XML类型的正文供将来使用。

One or more DAV:set XML elements may be included in the DAV:mkcol XML element to allow setting properties on the collection as it is created. In particular, to create a collection of a particular type, the DAV:resourcetype XML element MUST be included in a DAV:set XML element and MUST specify the expected resource type elements for the new resource, which MUST include the DAV:collection element that needs to be present for any WebDAV collection.

DAV:mkcol XML元素中可能包含一个或多个DAV:set XML元素,以允许在创建集合时设置集合的属性。特别是,要创建特定类型的集合,DAV:resourcetype XML元素必须包含在DAV:set XML元素中,并且必须为新资源指定预期的资源类型元素,该元素必须包含任何WebDAV集合都需要存在的DAV:collection元素。

As per the PROPPATCH method (Section 9.2 of [RFC4918]), servers MUST process any DAV:set instructions in document order (an exception to the normal rule that ordering is irrelevant). If any one instruction fails to execute successfully, all instructions MUST fail (i.e., either all succeed or all fail). Thus, if any error occurs during processing, all executed instructions MUST be undone and a proper error result returned. Failure to set a property value on the collection MUST result in a failure of the overall MKCOL request -- i.e., the collection is not created.

根据PROPPATCH方法(RFC4918第9.2节),服务器必须按文档顺序处理任何DAV:set指令(与排序无关的正常规则除外)。如果任何一条指令未能成功执行,则所有指令都必须失败(即全部成功或全部失败)。因此,如果在处理过程中发生任何错误,则必须撤消所有执行的指令,并返回正确的错误结果。未能在集合上设置属性值必须导致整个MKCOL请求失败——即,集合未创建。

The response to an extended MKCOL request MUST be an XML document containing a single DAV:mkcol-response XML element, which MUST contain DAV:propstat XML elements with the status of each property when the request fails due to a failure to set one or more of the properties specified in the request body. The server MAY return a response body in the case where the request is successful, indicating success for setting each property specified in the request body. When an empty response body is returned with a success request status code, the client can assume that all properties were set.

对扩展MKCOL请求的响应必须是包含单个DAV:MKCOL response XML元素的XML文档,该元素必须包含DAV:propstat XML元素,当由于未能设置请求正文中指定的一个或多个属性而导致请求失败时,该元素的状态为每个属性。在请求成功的情况下,服务器可能会返回一个响应正文,指示设置请求正文中指定的每个属性的成功。当返回带有成功请求状态代码的空响应正文时,客户机可以假定已设置所有属性。

In all other respects, the behavior of the extended MKCOL request follows that of the standard MKCOL request.

在所有其他方面,扩展MKCOL请求的行为遵循标准MKCOL请求的行为。

3.1. Extended MKCOL Support
3.1. 扩展MKCOL支持

A server supporting the features described in this document MUST include "extended-mkcol" as a field in the DAV response header from an OPTIONS request on any URI that supports use of the extended MKCOL method.

支持本文档所述功能的服务器必须在任何支持使用扩展mkcol方法的URI上的选项请求的DAV响应头中包含“扩展mkcol”字段。

3.1.1. Example: Using OPTIONS for the Discovery of Support for Extended MKCOL

3.1.1. 示例:使用选项查找对扩展MKCOL的支持

   >> Request <<
        
   >> Request <<
        
   OPTIONS /addressbooks/users/ HTTP/1.1
   Host: addressbook.example.com
        
   OPTIONS /addressbooks/users/ HTTP/1.1
   Host: addressbook.example.com
        
   >> Response <<
        
   >> Response <<
        
   HTTP/1.1 200 OK
   Allow: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE
   Allow: MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, REPORT, ACL
   DAV: 1, 2, 3, access-control, extended-mkcol
   Date: Sat, 11 Nov 2006 09:32:12 GMT
   Content-Length: 0
        
   HTTP/1.1 200 OK
   Allow: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE
   Allow: MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, REPORT, ACL
   DAV: 1, 2, 3, access-control, extended-mkcol
   Date: Sat, 11 Nov 2006 09:32:12 GMT
   Content-Length: 0
        
3.2. Status Codes
3.2. 状态代码

As per Section 9.3.1 of [RFC4918].

根据[RFC4918]第9.3.1节。

3.3. Additional Precondition for Extended MKCOL
3.3. 扩展MKCOL的附加先决条件

WebDAV ([RFC4918], Section 16) defines preconditions and postconditions for request behavior. This specification adds the following precondition for the extended MKCOL request.

WebDAV([RFC4918],第16节)定义了请求行为的先决条件和后决条件。本规范为扩展的MKCOL请求添加了以下先决条件。

Name: valid-resourcetype

名称:有效资源类型

Namespace: DAV:

名称空间:DAV:

Use with: Typically 403 (Forbidden)

用于:通常为403(禁止)

Purpose: (precondition) -- The server MUST support the specified resourcetype value for the specified collection.

用途:(前提条件)--服务器必须支持指定集合的指定resourcetype值。

3.4. Example: Successful Extended MKCOL Request
3.4. 示例:成功的扩展MKCOL请求

This example shows how the extended MKCOL request is used to create a collection of a fictitious type "special-resource". The response body is empty as the request completed successfully.

此示例显示如何使用扩展的MKCOL请求创建虚拟类型“特殊资源”的集合。请求成功完成时,响应正文为空。

   >> Request <<
        
   >> Request <<
        
   MKCOL /home/special/ HTTP/1.1
   Host: special.example.com
   Content-Type: application/xml; charset="utf-8"
   Content-Length: xxxx
        
   MKCOL /home/special/ HTTP/1.1
   Host: special.example.com
   Content-Type: application/xml; charset="utf-8"
   Content-Length: xxxx
        
   <?xml version="1.0" encoding="utf-8" ?>
   <D:mkcol xmlns:D="DAV:"
                 xmlns:E="http://example.com/ns/">
     <D:set>
       <D:prop>
         <D:resourcetype>
           <D:collection/>
           <E:special-resource/>
         </D:resourcetype>
         <D:displayname>Special Resource</D:displayname>
       </D:prop>
     </D:set>
   </D:mkcol>
        
   <?xml version="1.0" encoding="utf-8" ?>
   <D:mkcol xmlns:D="DAV:"
                 xmlns:E="http://example.com/ns/">
     <D:set>
       <D:prop>
         <D:resourcetype>
           <D:collection/>
           <E:special-resource/>
         </D:resourcetype>
         <D:displayname>Special Resource</D:displayname>
       </D:prop>
     </D:set>
   </D:mkcol>
        
   >> Response <<
        
   >> Response <<
        
   HTTP/1.1 201 Created
   Cache-Control: no-cache
   Date: Sat, 11 Nov 2006 09:32:12 GMT
        
   HTTP/1.1 201 Created
   Cache-Control: no-cache
   Date: Sat, 11 Nov 2006 09:32:12 GMT
        
3.5. Example: Unsuccessful Extended MKCOL Request
3.5. 示例:扩展MKCOL请求失败

This example shows an attempt to use the extended MKCOL request to create a collection of a fictitious type "special-resource", which is not actually supported by the server. The response body shows that an error occurred specifically with the DAV:resourcetype property.

此示例显示了使用扩展的MKCOL请求创建虚拟类型“特殊资源”的集合的尝试,服务器实际上不支持该集合。响应正文显示特定于DAV:resourcetype属性发生的错误。

   >> Request <<
        
   >> Request <<
        
   MKCOL /home/special/ HTTP/1.1
   Host: special.example.com
   Content-Type: application/xml; charset="utf-8"
   Content-Length: xxxx
        
   MKCOL /home/special/ HTTP/1.1
   Host: special.example.com
   Content-Type: application/xml; charset="utf-8"
   Content-Length: xxxx
        
   <?xml version="1.0" encoding="utf-8" ?>
   <D:mkcol xmlns:D="DAV:"
                 xmlns:E="http://example.com/ns/">
     <D:set>
       <D:prop>
         <D:resourcetype>
           <D:collection/>
           <E:special-resource/>
         </D:resourcetype>
         <D:displayname>Special Resource</D:displayname>
       </D:prop>
     </D:set>
   </D:mkcol>
        
   <?xml version="1.0" encoding="utf-8" ?>
   <D:mkcol xmlns:D="DAV:"
                 xmlns:E="http://example.com/ns/">
     <D:set>
       <D:prop>
         <D:resourcetype>
           <D:collection/>
           <E:special-resource/>
         </D:resourcetype>
         <D:displayname>Special Resource</D:displayname>
       </D:prop>
     </D:set>
   </D:mkcol>
        
   >> Response <<
        
   >> Response <<
        
   HTTP/1.1 403 Forbidden
   Cache-Control: no-cache
   Date: Sat, 11 Nov 2006 09:32:12 GMT
   Content-Type: application/xml; charset="utf-8"
   Content-Length: xxxx
        
   HTTP/1.1 403 Forbidden
   Cache-Control: no-cache
   Date: Sat, 11 Nov 2006 09:32:12 GMT
   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:resourcetype/>
       </D:prop>
       <D:status>HTTP/1.1 403 Forbidden</D:status>
       <D:error><D:valid-resourcetype /></D:error>
       <D:responsedescription>Resource type is not
       supported by this server</D:responsedescription>
     </D:propstat>
     <D:propstat>
       <D:prop>
         <D:displayname/>
       </D:prop>
       <D:status>HTTP/1.1 424 Failed Dependency</D:status>
     </D:propstat>
   </D:mkcol-response>
        
   <?xml version="1.0" encoding="utf-8" ?>
   <D:mkcol-response xmlns:D="DAV:">
     <D:propstat>
       <D:prop>
         <D:resourcetype/>
       </D:prop>
       <D:status>HTTP/1.1 403 Forbidden</D:status>
       <D:error><D:valid-resourcetype /></D:error>
       <D:responsedescription>Resource type is not
       supported by this server</D:responsedescription>
     </D:propstat>
     <D:propstat>
       <D:prop>
         <D:displayname/>
       </D:prop>
       <D:status>HTTP/1.1 424 Failed Dependency</D:status>
     </D:propstat>
   </D:mkcol-response>
        
4. Using Extended MKCOL as an Alternative for MKxxx Methods
4. 使用扩展的MKCOL作为MKxxx方法的替代方法

One of the goals of this extension is to eliminate the need for other extensions to define their own variant of MKCOL to create the special collections they need. This extension can be used as an alternative to existing MKxxx methods in other extensions as detailed below. If a server supports this extension and the other extension listed, then the server MUST support use of the extended MKCOL method to achieve the same result as the MKxxx method of the other extension.

此扩展的目标之一是消除其他扩展定义自己的MKCOL变体以创建所需特殊集合的需要。此扩展可作为其他扩展中现有MKxxx方法的替代方法,如下所述。如果服务器支持此扩展和列出的其他扩展,则服务器必须支持使用扩展的MKCOL方法,以获得与其他扩展的MKxxx方法相同的结果。

4.1. MKCALENDAR Alternative
4.1. MKCALENDAR备选方案

CalDAV defines the MKCALENDAR method to create a calendar collection as well as to set properties during creation (Section 5.3.1 of [RFC4791]).

CalDAV定义了MKCALENDAR方法,用于创建日历集合以及在创建过程中设置属性(参见[RFC4791]第5.3.1节)。

The extended MKCOL method can be used instead by specifying both DAV: collection and CALDAV:calendar-collection XML elements in the DAV: resourcetype property, set during the extended MKCOL request.

可以通过在扩展MKCOL请求期间设置的DAV:resourcetype属性中指定DAV:collection和CALDAV:calendar collection XML元素来使用扩展MKCOL方法。

4.1.1. Example: Using MKCOL Instead of MKCALENDAR
4.1.1. 示例:使用MKCOL而不是MKCALENDAR

The first example below shows an MKCALENDAR request containing a CALDAV:mkcalendar XML element in the request body and returning a CALDAV:mkcalendar-response XML element in the response body.

下面的第一个示例显示了一个MKCALENDAR请求,该请求在请求正文中包含一个CALDAV:MKCALENDAR XML元素,并在响应正文中返回一个CALDAV:MKCALENDAR响应XML元素。

   >> MKCALENDAR Request <<
        
   >> MKCALENDAR Request <<
        
   MKCALENDAR /home/lisa/calendars/events/ HTTP/1.1
   Host: calendar.example.com
   Content-Type: application/xml; charset="utf-8"
   Content-Length: xxxx
        
   MKCALENDAR /home/lisa/calendars/events/ HTTP/1.1
   Host: calendar.example.com
   Content-Type: application/xml; charset="utf-8"
   Content-Length: xxxx
        
   <?xml version="1.0" encoding="utf-8" ?>
   <C:mkcalendar xmlns:D="DAV:"
                 xmlns:C="urn:ietf:params:xml:ns:caldav">
     <D:set>
       <D:prop>
         <D:displayname>Lisa's Events</D:displayname>
       </D:prop>
     </D:set>
   </C:mkcalendar>
        
   <?xml version="1.0" encoding="utf-8" ?>
   <C:mkcalendar xmlns:D="DAV:"
                 xmlns:C="urn:ietf:params:xml:ns:caldav">
     <D:set>
       <D:prop>
         <D:displayname>Lisa's Events</D:displayname>
       </D:prop>
     </D:set>
   </C:mkcalendar>
        
   >> MKCALENDAR Response <<
        
   >> MKCALENDAR Response <<
        
   HTTP/1.1 201 Created
   Cache-Control: no-cache
   Date: Sat, 11 Nov 2006 09:32:12 GMT
   Content-Type: application/xml; charset="utf-8"
   Content-Length: xxxx
        
   HTTP/1.1 201 Created
   Cache-Control: no-cache
   Date: Sat, 11 Nov 2006 09:32:12 GMT
   Content-Type: application/xml; charset="utf-8"
   Content-Length: xxxx
        
   <?xml version="1.0" encoding="utf-8" ?>
   <C:mkcalendar-response xmlns:D="DAV:"
                 xmlns:C="urn:ietf:params:xml:ns:caldav">
     <D:propstat>
       <D:prop>
         <D:displayname/>
       </D:prop>
       <D:status>HTTP/1.1 200 OK</D:status>
     </D:propstat>
   </C:mkcalendar-response>
        
   <?xml version="1.0" encoding="utf-8" ?>
   <C:mkcalendar-response xmlns:D="DAV:"
                 xmlns:C="urn:ietf:params:xml:ns:caldav">
     <D:propstat>
       <D:prop>
         <D:displayname/>
       </D:prop>
       <D:status>HTTP/1.1 200 OK</D:status>
     </D:propstat>
   </C:mkcalendar-response>
        

The second example shows the equivalent extended MKCOL request with the same request and response XML elements.

第二个示例显示了具有相同请求和响应XML元素的等效扩展MKCOL请求。

   >> MKCOL Request <<
        
   >> MKCOL Request <<
        
   MKCOL /home/lisa/calendars/events/ HTTP/1.1
   Host: calendar.example.com
   Content-Type: application/xml; charset="utf-8"
   Content-Length: xxxx
        
   MKCOL /home/lisa/calendars/events/ HTTP/1.1
   Host: calendar.example.com
   Content-Type: application/xml; charset="utf-8"
   Content-Length: xxxx
        
   <?xml version="1.0" encoding="utf-8" ?>
   <D:mkcol xmlns:D="DAV:"
                 xmlns:C="urn:ietf:params:xml:ns:caldav">
     <D:set>
       <D:prop>
         <D:resourcetype>
           <D:collection/>
           <C:calendar/>
         </D:resourcetype>
         <D:displayname>Lisa's Events</D:displayname>
       </D:prop>
     </D:set>
   </D:mkcol>
        
   <?xml version="1.0" encoding="utf-8" ?>
   <D:mkcol xmlns:D="DAV:"
                 xmlns:C="urn:ietf:params:xml:ns:caldav">
     <D:set>
       <D:prop>
         <D:resourcetype>
           <D:collection/>
           <C:calendar/>
         </D:resourcetype>
         <D:displayname>Lisa's Events</D:displayname>
       </D:prop>
     </D:set>
   </D:mkcol>
        
   >> MKCOL Response <<
        
   >> MKCOL Response <<
        
   HTTP/1.1 201 Created
   Cache-Control: no-cache
   Date: Sat, 11 Nov 2006 09:32:12 GMT
   Content-Type: application/xml; charset="utf-8"
   Content-Length: xxxx
        
   HTTP/1.1 201 Created
   Cache-Control: no-cache
   Date: Sat, 11 Nov 2006 09:32:12 GMT
   Content-Type: application/xml; charset="utf-8"
   Content-Length: xxxx
        
   <?xml version="1.0" encoding="utf-8" ?>
   <D:mkcol-response xmlns:D="DAV:"
                 xmlns:C="urn:ietf:params:xml:ns:caldav">
     <D:propstat>
       <D:prop>
         <D:resourcetype/>
         <D:displayname/>
       </D:prop>
       <D:status>HTTP/1.1 200 OK</D:status>
     </D:propstat>
   </D:mkcol-response>
        
   <?xml version="1.0" encoding="utf-8" ?>
   <D:mkcol-response xmlns:D="DAV:"
                 xmlns:C="urn:ietf:params:xml:ns:caldav">
     <D:propstat>
       <D:prop>
         <D:resourcetype/>
         <D:displayname/>
       </D:prop>
       <D:status>HTTP/1.1 200 OK</D:status>
     </D:propstat>
   </D:mkcol-response>
        
5. XML Element Definitions
5. XML元素定义
5.1. mkcol XML Element
5.1. mkcolxml元素

Name: mkcol

姓名:mkcol

Namespace: DAV:

名称空间:DAV:

Purpose: Used in a request to specify properties to be set in an extended MKCOL request, as well as any additional information needed when creating the resource.

用途:用于请求中,以指定要在扩展MKCOL请求中设置的属性,以及创建资源时所需的任何其他信息。

Description: This XML element is a container for the information required to modify the properties on a collection resource as it is created in an extended MKCOL request.

描述:此XML元素是一个容器,用于在扩展的MKCOL请求中创建集合资源时,修改集合资源属性所需的信息。

Definition:

定义:

       <!ELEMENT mkcol (set+)>
        
       <!ELEMENT mkcol (set+)>
        
5.2. mkcol-response XML Element
5.2. mkcol响应XML元素

Name: mkcol-response

名称:mkcol响应

Namespace: DAV:

名称空间:DAV:

Purpose: Used in a response to indicate the status of properties that were set or failed to be set during an extended MKCOL request.

用途:在响应中用于指示在扩展MKCOL请求期间设置或未能设置的属性的状态。

Description: This XML element is a container for the information returned about a resource that has been created in an extended MKCOL request.

描述:此XML元素是一个容器,用于存储在扩展MKCOL请求中创建的资源的相关信息。

Definition:

定义:

       <!ELEMENT mkcol-response (propstat+)>
        
       <!ELEMENT mkcol-response (propstat+)>
        
6. Security Considerations
6. 安全考虑

This extension does not introduce any new security concerns beyond those already described in HTTP [RFC2616] and WebDAV [RFC4918].

除了HTTP[RFC2616]和WebDAV[RFC4918]中已经描述的安全问题外,此扩展不会引入任何新的安全问题。

7. Acknowledgments
7. 致谢

Thanks to Bernard Desruisseaux, Mike Douglass, Alexey Melnikov, Julian Reschke, and Simon Vaillancourt.

感谢伯纳德·德鲁伊斯、迈克·道格拉斯、阿列克西·梅尔尼科夫、朱利安·雷什克和西蒙·维兰科特。

8. Normative References
8. 规范性引用文件

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月。

[RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.

[RFC2616]菲尔丁,R.,盖蒂斯,J.,莫卧儿,J.,弗莱斯蒂克,H.,马斯特,L.,利奇,P.,和T.伯纳斯李,“超文本传输协议——HTTP/1.1”,RFC 2616,1999年6月。

[RFC4791] Daboo, C., Desruisseaux, B., and L. Dusseault, "Calendaring Extensions to WebDAV (CalDAV)", RFC 4791, March 2007.

[RFC4791]Daboo,C.,Desruisseaux,B.,和L.Dusseault,“WebDAV(CalDAV)的日历扩展”,RFC 47912007年3月。

[RFC4918] Dusseault, L., "HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)", RFC 4918, June 2007.

[RFC4918]Dusseault,L.,“用于Web分布式创作和版本控制(WebDAV)的HTTP扩展”,RFC4918,2007年6月。

[W3C.REC-xml-20081126] Maler, E., Yergeau, F., Paoli, J., Bray, T., and C. Sperberg-McQueen, "Extensible Markup Language (XML) 1.0 (Fifth Edition)", World Wide Web Consortium Recommendation REC-xml-20081126, November 2008, <http://www.w3.org/TR/2008/REC-xml-20081126>.

[W3C.REC-xml-20081126]Maler,E.,Yergeau,F.,Paoli,J.,Bray,T.,和C.Sperberg McQueen,“可扩展标记语言(xml)1.0(第五版)”,万维网联盟建议REC-xml-20081126,2008年11月<http://www.w3.org/TR/2008/REC-xml-20081126>.

Author's Address

作者地址

Cyrus Daboo Apple Inc. 1 Infinite Loop Cupertino, CA 95014 USA

Cyrus Daboo苹果公司,美国加利福尼亚州库珀蒂诺市无限环路1号,邮编95014

   EMail: cyrus@daboo.name
   URI:   http://www.apple.com/
        
   EMail: cyrus@daboo.name
   URI:   http://www.apple.com/