Sample code for 30+ languages & platforms
Xbase++ Requires Chilkat v11.0.0+

Wasabi Delete Bucket Objects

See more Wasabi Examples

Demonstrates how to delete one or more objects in a bucket.

Chilkat Xbase++ Downloads

Xbase++
LOCAL nSuccess
LOCAL oHttp
LOCAL cBucketName
LOCAL cObjectName1
LOCAL cObjectName2
LOCAL oSt
LOCAL oResp

nSuccess := 0

//  This example requires the Chilkat API to have been previously unlocked.
//  See Global Unlock Sample for sample code.

oHttp := CreateObject("Chilkat.Http")

//  Insert your access key here:
oHttp:AwsAccessKey := "access-key"

//  Insert your secret key here:
oHttp:AwsSecretKey := "secret-key"

//  Use the endpoint matching the bucket's region.
oHttp:AwsEndpoint := "s3.us-west-1.wasabisys.com"

cBucketName := "chilkattest"

cObjectName1 := "seahorse.jpg"
cObjectName2 := "seahorse2.jpg"

oSt := CreateObject("Chilkat.StringTable")
oSt:Append(cObjectName1)
oSt:Append(cObjectName2)

oResp := CreateObject("Chilkat.HttpResponse")
nSuccess := oHttp:S3_DeleteObjects(cBucketName, oSt, oResp)
IF (nSuccess == 0)
    ? oHttp:LastErrorText
    oHttp:destroy()
    oSt:destroy()
    oResp:destroy()
    RETURN
ENDIF

? "Response status code = " + Str(oHttp:LastStatus)

//  Display the XML response.
? oResp:BodyStr

oHttp:destroy()
oSt:destroy()
oResp:destroy()