The
WebDAVBDELETE Method is similar to the
DELETE Method but it is used to delete one or more target resources.
Unlike the DELETE Method, the BDELETE Method contains a request body which must
contain at least one target XML Element.
The response for the BDELETE Method is identical to the response for the
DELETE Method. If all target resources are deleted successfully,
no response body is required. If there are errors deleting specific resources, these are
identified in a 207 (Multi-Status) response.
The BDELETE Method is not supported in
transactions.
The list of WebDAV Protocol Status Codes in the following table
is not comprehensive. For information about 500-level status codes, see WebDAV Status Codes: 500s.
Status Codes
| Status Code | Meaning |
|---|
| 204 (No Content) | Standard success response. |
| 423 (Locked) | The destination resource is locked. |
| 424 (Method Failure) | The method cannot be supported in a
transaction. |
Example
The following example illustrates a
WebDAVBDELETE Method. Because the
request was successful, the response is not a 207 (Multi-Status).
Request
BDELETE /container/ HTTP/1.1
Host: www.contoso.com
Content-type: text/xml
Content-Length: xxxx
<?xml version="1.0" ?>
<D:delete xmlns:D="DAV:">
<D:target>
<D:href>file1</D:href>
<D:href>file2</D:href>
</D:target>
</D:delete>
Response
Example
In this example file1 is not contained in the response because it was deleted successfully; file2 was not found; and there
was an error that prevented the collection named "box" and one of the resources it contains from being deleted.
Request
BDELETE /container/ HTTP/1.1
Host: www.contoso.com
Content-type: text/xml
Content-Length: xxxx
<?xml version="1.0" ?>
<D:delete xmlns:D="DAV:">
<D:target>
<D:href>file1</D:href>
<D:href>file2</D:href>
<D:href>box</D:href>
</D:target>
</D:delete>
Response
HTTP/1.1 207 Multi-Status
Content-Type: text/xml
Content-Length: xxxx
<?xml version="1.0" ?>
<D:multistatus xmlns:D="DAV:">
<D:response>
<D:href>http://www.contoso.com/container/file2</D:href>
<D:status>HTTP/1.1 404 Not Found</D:status>
</D:response>
<D:response>
<D:href>http://www.contoso.com/container/box/resource3.htm</D:href>
<D:status>HTTP/1.1 423 Locked</D:status>
<D:lockdiscovery>
<D:activelock>
<D:locktype><D:write/></D:locktype>
<D:lockscope><D:exclusive/></D:lockscope>
<D:depth>0</D:depth>
<D:owner>Jane Smith</D:owner>
<D:timeout>Infinite</D:timeout>
<D:locktoken>
<D:href>opaquelocktoken:f81de2ad-7f3d-a1b2-4f3c-00a0c91a9d</D:href>
</D:locktoken>
</D:activelock>
</D:lockdiscovery>
</D:response>
</D:multistatus>
Related Topics