< Previous | Contents | Next >

Creating a folder

You use the HTTP PUT method to create a folder in a bucket. To create a folder, you need write permission for the bucket.


To tell HCP to create a folder instead of an object in response to a PUT

request, you can do either these:


Include a forward slash (/) or the percent-encoded equivalent (%2F) after the folder name in the request.


Include the Content-Type header in the request with a value of

x-directory.


In either case, you also need to include the Content-Length header in the request. However, HCP ignores any request body.


When you create a folder, you specify a name for it. The rules for folder names are the same as the rules for object names. For more information on object names, see “Object names” on page 16.


Chapter 6: Working with objects 133

Creating a folder


 

Request lineRequest headersResponse headersHTTP status codesExample: Creating a folder