Request

Method

Table 1 Method description

Method

URI

Description

POST

/v1/{account}/{container}/{object}

Creates, updates, or deletes object metadata.

{account} indicates the name of an account.

{container} indicates the name of a container.

{object} indicates the name of an object.

A POST request deletes all existing user metadata.

Metadata creation or update depends on whether the specified metadata already exists. Existing metadata is updated, and missing metadata is created.

This operation does not involve a request body.

Example Request

Create or update metadata:

curl -i $publicURL/marktwain/goodbye  -X POST -H "X-Auth-Token:$token" -H "X-Object-Meta-name:value"

Delete metadata:

curl -i $publicURL/marktwain/goodbye -X POST -H "X-Auth-Token:$token" -H "X-Object-Meta-name:"

Request Query Parameters

This request does not include query parameters.

Request Headers

Request URI parameters

Parameter

Type

Description

{account}

String

(Required)

A unique account name. In the current version, it indicates a unique ID for the account.

{container}

String

(Required)

A unique container name.

For details about container naming rules, see Naming Rules.

{object}

String

(Required)

An object name.

For details about object naming rules, see Object Naming Rules.

Table 2 Request header parameters

Header

Type

Description

X-Auth-Token

String

(Required)

Authentication token. If you omit this header, your request fails unless the account owner has granted you access through an ACL.

X-Object-Meta-name

String

(Optional)

Object metadata, where {name} is the name of the metadata item. To delete this item, leave {name} empty in this header. You must specify an X-Object-Meta-{name} header for each metadata item (for each {name}) that you want to add or update.

Content-Type

String

(Optional)

Sets the MIME type of the object.

X-Detect-Content-Type

Boolean

(Optional)

If it is set to true, OBS guesses the content type based on the file name extension and ignores the value sent in the Content-Type header, if present.

Content-Length

String

(Optional)

Set to the length of the object content. Do not set if chunked transfer encoding is being used.

Content-Disposition

String

(Optional)

When the header is set to {newname} and an object is downloaded through a browser, the default object name {newname} is returned.

Content-Encoding

String

(Optional)

If this header is set, the value is the encoding format used when an object is downloaded through a browser.