(Unicode C) S3 Delete Bucket
Demonstrates how to delete a bucket.
#include <C_CkHttpW.h>
void ChilkatSample(void)
{
HCkHttpW http;
BOOL success;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http = CkHttpW_Create();
// Insert your access key here:
CkHttpW_putAwsAccessKey(http,L"ABQXXABC83ABCDEFVQXX");
// Insert your secret key here:
CkHttpW_putAwsSecretKey(http,L"XXXXYYYYabcdABCD12345678xxxxyyyyzzzz");
CkHttpW_putKeepResponseBody(http,TRUE);
success = CkHttpW_S3_DeleteBucket(http,L"chilkattestbucket");
if (success != TRUE) {
wprintf(L"%s\n",CkHttpW_lastErrorText(http));
// Also examine the error response body from AWS:
wprintf(L"%s\n",CkHttpW_lastResponseBody(http));
}
else {
wprintf(L"Bucket deleted.\n");
}
CkHttpW_Dispose(http);
}
|