MKCOL

The MKCOL method creates a new Collection object at the request URI. A MKCOL request will only succeed if all the parents exist. This is important to note as it means that to create Collections within Collections each layer must be created with separate MKCOL requests.

Status Codes

201 Created The Collection has been created
403 Forbidden It's not possible to create new Collections at the Request URI
405 Method Not Allowed The Collection already exists
409 Conflict The parent Collection does not exist

Example 1: Creating a new Collection

This creates a new folder called Test within /Example/Files/. As /Example/Files/ already exists this request succeeds.

Request

......
MKCOL /Example/Files/Test/  HTTP/1.1
......

Response

HTTP/1.1 201 Created 

Example 2: An unsuccessful MKCOL request

The following request attempts to create a folder /Example/Files/Fail/Test, however as /Example/Files/Fail does not exist, the request fails.

Request

......
MKCOL /Example/Files/Fail/Test  HTTP/1.1
.....

Response

HTTP/1.1 409 Conflict

Copyright 2013 CHLSoftware. All rights reserved. All trademarks acknowledged.