Sample code for 30+ languages & platforms
Unicode C

S3 Delete Bucket

See more Amazon S3 Examples

Demonstrates how to delete a bucket.

Chilkat Unicode C Downloads

Unicode C
#include <C_CkHttpW.h>

void ChilkatSample(void)
    {
    BOOL success;
    HCkHttpW http;

    success = FALSE;

    // 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);

    }