C
C
S3 Delete Bucket
See more Amazon S3 Examples
Demonstrates how to delete a bucket.Chilkat C Downloads
#include <C_CkHttp.h>
void ChilkatSample(void)
{
BOOL success;
HCkHttp http;
success = FALSE;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http = CkHttp_Create();
// Insert your access key here:
CkHttp_putAwsAccessKey(http,"ABQXXABC83ABCDEFVQXX");
// Insert your secret key here:
CkHttp_putAwsSecretKey(http,"XXXXYYYYabcdABCD12345678xxxxyyyyzzzz");
CkHttp_putKeepResponseBody(http,TRUE);
success = CkHttp_S3_DeleteBucket(http,"chilkattestbucket");
if (success != TRUE) {
printf("%s\n",CkHttp_lastErrorText(http));
// Also examine the error response body from AWS:
printf("%s\n",CkHttp_lastResponseBody(http));
}
else {
printf("Bucket deleted.\n");
}
CkHttp_Dispose(http);
}