Sample code for 30+ languages & platforms
Unicode C

Wasabi Delete Bucket

See more Wasabi Examples

Demonstrates how to delete a new Wasabi 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"access-key");

    // Insert your secret key here:
    CkHttpW_putAwsSecretKey(http,L"secret-key");

    // To delete a bucket located in a different region, use the domain for that region, such as "s3.eu-central-1.wasabisys.com"
    CkHttpW_putAwsEndpoint(http,L"s3.wasabisys.com");

    CkHttpW_putKeepResponseBody(http,TRUE);

    success = CkHttpW_S3_DeleteBucket(http,L"chilkat-wasabi-testbucket");

    if (success != TRUE) {
        wprintf(L"%s\n",CkHttpW_lastErrorText(http));
        // Also examine the error response body from Wasabi:
        wprintf(L"%s\n",CkHttpW_lastResponseBody(http));
    }
    else {
        wprintf(L"Bucket deleted.\n");
    }



    CkHttpW_Dispose(http);

    }