Network Working Group
Request for Comments: 4918
Obsoletes: 2518
Category: Standards Track
L.M. Dusseault, Editor
CommerceNet
June 2007
HTTP Extensions for Web Distributed Authoring and
Versioning (WebDAV)
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.
Copyright Notice
Copyright © The IETF Trust (2007). All Rights Reserved.
Abstract
Web Distributed Authoring and Versioning (WebDAV) consists of a set of methods, headers, and content-types
ancillary to HTTP/1.1 for the management of resource properties, creation and management of resource
collections, URL namespace manipulation, and resource locking (collision avoidance).
RFC 2518 was published in February 1999, and this specification obsoletes RFC 2518 with minor revisions
mostly due to interoperability experience.
Dusseault
Standards Track
[Page 1]
RFC 4918
WebDAV
June 2007
Table of Contents
1 Introduction .............................................................................................................................................................8
2 Notational Conventions .......................................................................................................................................... 9
3 Terminology ...........................................................................................................................................................10
4 Data Model for Resource Properties ...................................................................................................................11
4.1 The Resource Property Model ........................................................................................................................... 11
4.2 Properties and HTTP Headers ............................................................................................................................11
4.3 Property Values ..................................................................................................................................................11
4.3.1 Example - Property with Mixed Content ...................................................................................................... 12
4.4 Property Names ..................................................................................................................................................13
4.5 Source Resources and Output Resources ...........................................................................................................14
5 Collections of Web Resources .............................................................................................................................. 15
5.1 HTTP URL Namespace Model ..........................................................................................................................15
5.2 Collection Resources ..........................................................................................................................................15
6 Locking ...................................................................................................................................................................17
6.1 Lock Model ........................................................................................................................................................ 17
6.2 Exclusive vs. Shared Locks ............................................................................................................................... 17
6.3 Required Support ............................................................................................................................................... 18
6.4 Lock Creator and Privileges ...............................................................................................................................18
6.5 Lock Tokens .......................................................................................................................................................18
6.6 Lock Timeout .....................................................................................................................................................19
6.7 Lock Capability Discovery ................................................................................................................................ 19
6.8 Active Lock Discovery ...................................................................................................................................... 20
7 Write Lock ............................................................................................................................................................. 21
7.1 Write Locks and Properties ................................................................................................................................21
7.2 Avoiding Lost Updates ...................................................................................................................................... 21
7.3 Write Locks and Unmapped URLs ....................................................................................................................22
7.4 Write Locks and Collections ..............................................................................................................................23
7.5 Write Locks and the If Request Header ............................................................................................................. 23
7.5.1 Example - Write Lock and COPY ................................................................................................................ 24
7.5.2 Example - Deleting a Member of a Locked Collection ................................................................................ 24
7.6 Write Locks and COPY/MOVE ........................................................................................................................ 25
7.7 Refreshing Write Locks ..................................................................................................................................... 25
8 General Request and Response Handling ...........................................................................................................26
8.1 Precedence in Error Handling ............................................................................................................................ 26
8.2 Use of XML ....................................................................................................................................................... 26
8.3 URL Handling ....................................................................................................................................................26
8.3.1 Example - Correct URL Handling ................................................................................................................ 27
Dusseault
Standards Track
[Page 2]
RFC 4918
WebDAV
June 2007
8.4 Required Bodies in Requests ............................................................................................................................. 27
8.5 HTTP Headers for Use in WebDAV ................................................................................................................. 27
8.6 ETag ................................................................................................................................................................... 27
8.7
Including Error Response Bodies ...................................................................................................................... 28
Impact of Namespace Operations on Cache Validators .....................................................................................28
8.8
9 HTTP Methods for Distributed Authoring ........................................................................................................ 29
9.1 PROPFIND Method ...........................................................................................................................................29
9.1.1 PROPFIND Status Codes ..............................................................................................................................29
9.1.2 Status Codes for Use in 'propstat' Element ................................................................................................... 30
9.1.3 Example - Retrieving Named Properties ...................................................................................................... 30
9.1.4 Example - Using 'propname' to Retrieve All Property Names ..................................................................... 31
9.1.5 Example - Using So-called 'allprop' ..............................................................................................................32
9.1.6 Example - Using 'allprop' with 'include' ....................................................................................................... 34
9.2 PROPPATCH Method ....................................................................................................................................... 34
9.2.1 Status Codes for Use in 'propstat' Element ................................................................................................... 35
9.2.2 Example - PROPPATCH .............................................................................................................................. 35
9.3 MKCOL Method ................................................................................................................................................36
9.3.1 MKCOL Status Codes .................................................................................................................................. 36
9.3.2 Example - MKCOL .......................................................................................................................................37
9.4 GET, HEAD for Collections ..............................................................................................................................37
9.5 POST for Collections ......................................................................................................................................... 37
9.6 DELETE Requirements ..................................................................................................................................... 37
9.6.1 DELETE for Collections ...............................................................................................................................37
9.6.2 Example - DELETE ...................................................................................................................................... 38
9.7 PUT Requirements .............................................................................................................................................38
9.7.1 PUT for Non-Collection Resources .............................................................................................................. 38
9.7.2 PUT for Collections ...................................................................................................................................... 39
9.8 COPY Method ....................................................................................................................................................39
9.8.1 COPY for Non-collection Resources ............................................................................................................39
9.8.2 COPY for Properties ..................................................................................................................................... 39
9.8.3 COPY for Collections ................................................................................................................................... 40
9.8.4 COPY and Overwriting Destination Resources ............................................................................................40
9.8.5 Status Codes ..................................................................................................................................................41
9.8.6 Example - COPY with Overwrite ................................................................................................................. 41
9.8.7 Example - COPY with No Overwrite ........................................................................................................... 42
9.8.8 Example - COPY of a Collection ..................................................................................................................42
9.9 MOVE Method .................................................................................................................................................. 42
9.9.1 MOVE for Properties .................................................................................................................................... 43
9.9.2 MOVE for Collections .................................................................................................................................. 43
9.9.3 MOVE and the Overwrite Header ................................................................................................................ 44
9.9.4 Status Codes ..................................................................................................................................................44
9.9.5 Example - MOVE of a Non-Collection ........................................................................................................ 44
9.9.6 Example - MOVE of a Collection .................................................................................................................45
9.10 LOCK Method ................................................................................................................................................. 45
9.10.1 Creating a Lock on an Existing Resource ...................................................................................................45
9.10.2 Refreshing Locks ........................................................................................................................................ 46
9.10.3 Depth and Locking ......................................................................................................................................46
9.10.4 Locking Unmapped URLs .......................................................................................................................... 46
9.10.5 Lock Compatibility Table ........................................................................................................................... 46
9.10.6 LOCK Responses ........................................................................................................................................47
9.10.7 Example - Simple Lock Request .................................................................................................................47
Dusseault
Standards Track
[Page 3]
RFC 4918
WebDAV
June 2007
9.10.8 Example - Refreshing a Write Lock ........................................................................................................... 48
9.10.9 Example - Multi-Resource Lock Request ...................................................................................................49
9.11 UNLOCK Method ............................................................................................................................................50
9.11.1 Status Codes ................................................................................................................................................50
9.11.2 Example - UNLOCK .................................................................................................................................. 50
10 HTTP Headers for Distributed Authoring ....................................................................................................... 52
10.1 DAV Header .................................................................................................................................................... 52
10.2 Depth Header ................................................................................................................................................... 52
10.3 Destination Header ...........................................................................................................................................53
10.4
If Header .......................................................................................................................................................... 53
10.4.1 Purpose ........................................................................................................................................................53
10.4.2 Syntax ..........................................................................................................................................................54
10.4.3 List Evaluation ............................................................................................................................................ 54
10.4.4 Matching State Tokens and ETags ..............................................................................................................55
10.4.5
If Header and Non-DAV-Aware Proxies ....................................................................................................55
10.4.6 Example - No-tag Production ..................................................................................................................... 55
10.4.7 Example - Using "Not" with No-tag Production .........................................................................................55
10.4.8 Example - Causing a Condition to Always Evaluate to True ..................................................................... 56
10.4.9 Example - Tagged List If Header in COPY ................................................................................................56
10.4.10 Example - Matching Lock Tokens with Collection Locks ....................................................................... 56
10.4.11 Example - Matching ETags on Unmapped URLs .................................................................................... 56
10.5 Lock-Token Header ......................................................................................................................................... 57
10.6 Overwrite Header .............................................................................................................................................57
10.7 Timeout Request Header ..................................................................................................................................57
11 Status Code Extensions to HTTP/1.1 ................................................................................................................ 58
207 Multi-Status ...............................................................................................................................................58
11.1
11.2
422 Unprocessable Entity ................................................................................................................................ 58
423 Locked .......................................................................................................................................................58
11.3
424 Failed Dependency ....................................................................................................................................58
11.4
11.5
507 Insufficient Storage ................................................................................................................................... 58
12 Use of HTTP Status Codes ................................................................................................................................. 59
412 Precondition Failed ................................................................................................................................... 59
12.1
12.2
414 Request-URI Too Long .............................................................................................................................59
13 Multi-Status Response ........................................................................................................................................ 60
13.1 Response Headers ............................................................................................................................................ 60
13.2 Handling Redirected Child Resources ............................................................................................................. 60
Internal Status Codes ....................................................................................................................................... 60
13.3
14 XML Element Definitions .................................................................................................................................. 61
activelock XML Element ................................................................................................................................. 61
14.1
allprop XML Element ...................................................................................................................................... 61
14.2
14.3
collection XML Element ..................................................................................................................................61
depth XML Element .........................................................................................................................................61
14.4
14.5
error XML Element ..........................................................................................................................................61
Dusseault
Standards Track
[Page 4]
RFC 4918
WebDAV
June 2007
exclusive XML Element .................................................................................................................................. 62
14.6
href XML Element ........................................................................................................................................... 62
14.7
include XML Element ......................................................................................................................................62
14.8
location XML Element .....................................................................................................................................62
14.9
lockentry XML Element ................................................................................................................................ 63
14.10
lockinfo XML Element .................................................................................................................................. 63
14.11
lockroot XML Element .................................................................................................................................. 63
14.12
lockscope XML Element ............................................................................................................................... 63
14.13
locktoken XML Element ................................................................................................................................63
14.14
locktype XML Element ..................................................................................................................................63
14.15
14.16 multistatus XML Element ..............................................................................................................................64
owner XML Element ..................................................................................................................................... 64
14.17
14.18
prop XML Element ........................................................................................................................................ 64
propertyupdate XML Element ....................................................................................................................... 64
14.19
propfind XML Element ..................................................................................................................................65
14.20
14.21
propname XML Element ............................................................................................................................... 65
propstat XML Element ...................................................................................................................................65
14.22
remove XML Element ................................................................................................................................... 65
14.23
response XML Element ................................................................................................................................. 66
14.24
14.25
responsedescription XML Element ................................................................................................................66
set XML Element ........................................................................................................................................... 66
14.26
shared XML Element ..................................................................................................................................... 66
14.27
14.28
status XML Element ...................................................................................................................................... 67
14.29
timeout XML Element ................................................................................................................................... 67
14.30 write XML Element ....................................................................................................................................... 67
15 DAV Properties ................................................................................................................................................... 68
creationdate Property ....................................................................................................................................... 68
15.1
displayname Property .......................................................................................................................................68
15.2
15.3
getcontentlanguage Property ............................................................................................................................69
getcontentlength Property ................................................................................................................................ 69
15.4
getcontenttype Property ................................................................................................................................... 69
15.5
15.6
getetag Property ............................................................................................................................................... 70
getlastmodified Property .................................................................................................................................. 70
15.7
15.8
lockdiscovery Property .................................................................................................................................... 71
15.8.1 Example - Retrieving DAV:lockdiscovery ................................................................................................. 71
resourcetype Property ...................................................................................................................................... 72
15.9
15.10
supportedlock Property .................................................................................................................................. 73
15.10.1 Example - Retrieving DAV:supportedlock ...............................................................................................73
16 Precondition/Postcondition XML Elements ..................................................................................................... 75
17 XML Extensibility in DAV .................................................................................................................................77
Dusseault
Standards Track
[Page 5]
RFC 4918
WebDAV
June 2007
18 DAV Compliance Classes ................................................................................................................................... 78
18.1 Class 1 .............................................................................................................................................................. 78
18.2 Class 2 .............................................................................................................................................................. 78
18.3 Class 3 .............................................................................................................................................................. 78
19 Internationalization Considerations ..................................................................................................................79
20 Security Considerations ......................................................................................................................................80
20.1 Authentication of Clients ................................................................................................................................. 80
20.2 Denial of Service ..............................................................................................................................................80
20.3 Security through Obscurity .............................................................................................................................. 80
20.4 Privacy Issues Connected to Locks ..................................................................................................................80
20.5 Privacy Issues Connected to Properties ........................................................................................................... 81
20.6
Implications of XML Entities .......................................................................................................................... 81
20.7 Risks Connected with Lock Tokens .................................................................................................................81
20.8 Hosting Malicious Content .............................................................................................................................. 82
21 IANA Considerations ..........................................................................................................................................83
21.1 New URI Schemes ........................................................................................................................................... 83
21.2 XML Namespaces ............................................................................................................................................83
21.3 Message Header Fields .................................................................................................................................... 83
21.3.1 DAV ............................................................................................................................................................ 83
21.3.2 Depth ...........................................................................................................................................................83
21.3.3 Destination .................................................................................................................................................. 83
21.3.4
If .................................................................................................................................................................. 84
21.3.5 Lock-Token .................................................................................................................................................84
21.3.6 Overwrite .................................................................................................................................................... 84
21.3.7 Timeout ....................................................................................................................................................... 84
21.4 HTTP Status Codes ..........................................................................................................................................84
22 Acknowledgements ..............................................................................................................................................86
23 Contributors to This Specification .................................................................................................................... 87
24 Authors of RFC 2518 .......................................................................................................................................... 88
25 References ............................................................................................................................................................ 89
25.1 Normative References ......................................................................................................................................89
25.2
Informative References .................................................................................................................................... 89
Author's Address .......................................................................................................................................................91
A Notes on Processing XML Elements ...................................................................................................................92
A.1 Notes on Empty XML Elements ....................................................................................................................... 92
A.2 Notes on Illegal XML Processing ..................................................................................................................... 92
A.3 Example - XML Syntax Error ...........................................................................................................................92
A.4 Example - Unexpected XML Element ..............................................................................................................92
B Notes on HTTP Client Compatibility ................................................................................................................. 94
Dusseault
Standards Track
[Page 6]
RFC 4918
WebDAV
June 2007
C The 'opaquelocktoken' Scheme and URIs ......................................................................................................... 95
D Lock-null Resources .............................................................................................................................................96
D.1 Guidance for Clients Using LOCK to Create Resources .................................................................................. 96
E Guidance for Clients Desiring to Authenticate ..................................................................................................97
F Summary of Changes from RFC 2518 ................................................................................................................98
F.1 Changes for Both Client and Server Implementations ...................................................................................... 98
F.2 Changes for Server Implementations .................................................................................................................98
F.3 Other Changes ....................................................................................................................................................99
Intellectual Property and Copyright Statements ................................................................................................. 101
Index .........................................................................................................................................................................102
Dusseault
Standards Track
[Page 7]
RFC 4918
WebDAV
June 2007
1. Introduction
This document describes an extension to the HTTP/1.1 protocol that allows clients to perform remote Web
content authoring operations. This extension provides a coherent set of methods, headers, request entity body
formats, and response entity body formats that provide operations for:
Properties: The ability to create, remove, and query information about Web pages, such as their authors,
creation dates, etc.
Collections: The ability to create sets of documents and to retrieve a hierarchical membership listing (like a
directory listing in a file system).
Locking: The ability to keep more than one person from working on a document at the same time. This
prevents the "lost update problem", in which modifications are lost as first one author, then another, writes
changes without merging the other author's changes.
Namespace Operations: The ability to instruct the server to copy and move Web resources, operations that
change the mapping from URLs to resources.
Requirements and rationale for these operations are described in a companion document, "Requirements for a
Distributed Authoring and Versioning Protocol for the World Wide Web" [RFC2291].
This document does not specify the versioning operations suggested by [RFC2291]. That work was done in a
separate document, "Versioning Extensions to WebDAV" [RFC3253].
The sections below provide a detailed introduction to various WebDAV abstractions: resource properties
(Section 4), collections of resources (Section 5), locks (Section 6) in general, and write locks (Section 7)
specifically.
These abstractions are manipulated by the WebDAV-specific HTTP methods (Section 9) and the extra HTTP
headers (Section 10) used with WebDAV methods. General considerations for handling HTTP requests and
responses in WebDAV are found in Section 8.
While the status codes provided by HTTP/1.1 are sufficient to describe most error conditions encountered by
WebDAV methods, there are some errors that do not fall neatly into the existing categories. This specification
defines extra status codes developed for WebDAV methods (Section 11) and describes existing HTTP status
codes (Section 12) as used in WebDAV. Since some WebDAV methods may operate over many resources, the
Multi-Status response (Section 13) has been introduced to return status information for multiple resources.
Finally, this version of WebDAV introduces precondition and postcondition (Section 16) XML elements in
error response bodies.
WebDAV uses XML ([REC-XML]) for property names and some values, and also uses XML to marshal
complicated requests and responses. This specification contains DTD and text definitions of all properties
(Section 15) and all other XML elements (Section 14) used in marshalling. WebDAV includes a few special
rules on extending WebDAV XML marshalling in backwards-compatible ways (Section 17).
Finishing off the specification are sections on what it means for a resource to be compliant with this
specification (Section 18), on internationalization support (Section 19), and on security (Section 20).
Dusseault
Standards Track
[Page 8]