(DataFlex) S3 Delete Bucket
Demonstrates how to delete a bucket.
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoHttp
Boolean iSuccess
String sTemp1
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Get Create (RefClass(cComChilkatHttp)) To hoHttp
If (Not(IsComObjectCreated(hoHttp))) Begin
Send CreateComObject of hoHttp
End
// Insert your access key here:
Set ComAwsAccessKey Of hoHttp To "ABQXXABC83ABCDEFVQXX"
// Insert your secret key here:
Set ComAwsSecretKey Of hoHttp To "XXXXYYYYabcdABCD12345678xxxxyyyyzzzz"
Set ComKeepResponseBody Of hoHttp To True
Get ComS3_DeleteBucket Of hoHttp "chilkattestbucket" To iSuccess
If (iSuccess <> True) Begin
Get ComLastErrorText Of hoHttp To sTemp1
Showln sTemp1
// Also examine the error response body from AWS:
Get ComLastResponseBody Of hoHttp To sTemp1
Showln sTemp1
End
Else Begin
Showln "Bucket deleted."
End
End_Procedure
|