Sample code for 30+ languages & platforms
Unicode C++

Example: Http.S3_FileExists method

Demonstrates the S3_FileExists method.

Chilkat Unicode C++ Downloads

Unicode C++
#include <CkHttpW.h>

void ChilkatSample(void)
    {
    CkHttpW http;

    //  Insert your AWS keys here:
    http.put_AwsAccessKey(L"AWS_ACCESS_KEY");
    http.put_AwsSecretKey(L"AWS_SECRET_KEY");

    const wchar_t *bucketName = L"chilkat.ocean";
    const wchar_t *objectName = L"seahorse.jpg";
    http.put_AwsRegion(L"us-west-2");
    http.put_AwsEndpoint(L"s3-us-west-2.amazonaws.com");

    int retval = http.S3_FileExists(bucketName,objectName);
    if (retval < 0) {
        wprintf(L"Failed to check for the S3 object existence\n");
        wprintf(L"%s\n",http.lastErrorText());
        return;
    }

    if (retval == 0) {
        wprintf(L"The S3 object does not exist.\n");
        return;
    }

    wprintf(L"The S3 object exists.\n");
    }