If a null version of an object exists, the DELETE operation removes the null version of the object and inserts a delete marker. For more details, see the following:
For a syntax example, see Amazon's official S3 DELETE Object API documentation (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html).
To remove a specific version, you must be the bucket owner and you must use the versionId subresource. Using this subresource permanently deletes the version. If the object deleted is a delete marker, S3 sets the response header, x-amz-delete-marker, to true.
This implementation of the DELETE Object operation does not support the use of request parameters.
This implementation of the DELETE Object operation does not support the use of request headers.
This implementation of the DELETE Object operation does not support the use of request elements.
This implementation of the DELETE Object operation supports the use of the x-amz-version-id response header. For more details about this response header, see Amazon's official S3 DELETE Object API documentation (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html).
This implementation of the DELETE Object operation does not return response elements.
204 No Content
The DELETE Object operation does not return special errors. For general information about S3 errors and a list of error codes, see S3 Client Error Handling Reference.
The following request deletes my-desk-image.jpg.
DELETE /my-desk-image.jpg HTTP/1.1 204 NoContent x-amz-request-id: tx0A49CE4060975EAC Date: Wed, 12 Oct 2018 17:50:00 GMT Content-Length: 0 Connection: close Server: Apache
The following request deletes the specified version of the object, my-desk-image.jpg.
DELETE /my-third-image.jpg?versionId=00012 HTTP/1.1 204 NoContent x-amz-request-id: tx0A49CE4060975EAC x-amz-version-id: 00012 Date: Wed, 12 Oct 2018 17:50:00 GMT Content-Length: 0 Connection: close Server: Apache
If the object deleted is a delete marker, the following response example appears.
HTTP/1.1 204 NoContent x-amz-request-id: tx0A49CE4060975EAC x-amz-version-id: 0011 x-amz-delete-marker: true Date: Wed, 12 Oct 2018 17:50:00 GMT Content-Length: 0 Connection: close Server: Apache