MKCOL Method
The WebDAVMKCOL method creates a new collection at the location specified by the Request-Uniform Resource Identifier (URI). When invoked without a request body, the collection will be created without member resources. When used with a request body, you can create members and properties on the collections or members.
The MKCOL method may be included in the scope of a transaction by submitting a Transaction Header with a lock token that corresponds to that transaction.
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 |
|---|---|
| 201 (Created) | The collection was created. |
| 401 (Access Denied) | Resource requires authorization or authorization was denied. |
| 403 (Forbidden) | The server does not allow collections to be created at the specified location, or the parent collection of the specified request URI exists but cannot accept members. |
| 405 (Method Not Allowed) | The MKCOL method can only be performed on a deleted or non-existent resource. |
| 409 (Conflict) | A resource cannot be created at the destination URI until one or more intermediate collections are created. |
| 415 (Unsupported Media Type) | The request type of the body is not supported by the server. |
| 507 (Insufficient Storage) | The destination resource does not have sufficient storage space. |
Example
The following example uses the WebDAVMKCOL method to create a collection called pub2/folder1/folder2 on the server www.contoso.com.
Request
MKCOL /pub2/folder1/folder2/ HTTP/1.1 Host: www.contoso.com Content-Type: text/xml Content-Length: XXX
Response
HTTP/1.1 201 Created