DeleteObject

Prev Next

Available in Classic and VPC

Delete an object stored in a Ncloud Storage bucket.

Note

When deleting objects from a bucket with version control enabled, see the following:

  • Delete without specifying version ID: The object is not deleted, but a deletion marker is added. After the deletion marker is added, the object is not displayed when the ListObjectsV2 API is called, and a response error is returned when the GetObject API is called.
  • Delete with version ID specified: The object version is permanently deleted.
  • Delete with specifying version ID of deletion marker: The deletion marker is removed, and the previous version of the object is displayed again and functions as the current object.

Request

This section describes the request format. The method and URI are as follows:

Method URI
DELETE /{Key}

Request headers

For information about the headers common to all Ncloud Storage APIs, see Ncloud Storage request headers.

Request path parameters

You can use the following path parameters with your request:

Field Type Required Description
Key String Required Object name

Request query parameters

You can use the following query parameters with your request:

Field Type Required Description
versionId String Optional Object version ID
  • See ListObjectVersions.
  • Enter when permanently deleting a specific version of an object from a bucket with version control enabled.

Request example

The request example is as follows:

DELETE /object.csv HTTP/1.1
Host: bucket.kr.ncloudstorage.com

Response

This section describes the response format.

Response headers

For information about the headers common to all Ncloud Storage APIs, see Ncloud Storage response headers.

Response status codes

For information about the HTTP status codes common to all Ncloud Storage APIs, see Common Ncloud Storage response status codes.

Response example

The response example is as follows:

If bucket has no version control enabled

The following is a sample response when the bucket has no version control enabled.

HTTP/1.1 204 No Content

If bucket has version control enabled

The following is a sample response when the bucket has version control enabled.

HTTP/1.1 204 No Content
x-amz-delete-marker: "true"