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

Shopware Digest Authentication

See more Shopware Examples

Demonstrates using Digest access authentication for Shopware.

Chilkat Unicode C++ Downloads

Unicode C++
#include <CkHttpW.h>
#include <CkStringBuilderW.h>
#include <CkJsonObjectW.h>

void ChilkatSample(void)
    {
    bool success = false;

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    CkHttpW http;

    // To use HTTP Digest Authentication, set the login and password, and also indicate that DigestAuth should be used.
    http.put_Login(L"api_username");
    http.put_Password(L"api_key");
    http.put_DigestAuth(true);

    CkStringBuilderW sbResponseBody;
    success = http.QuickGetSb(L"https://my-shopware-shop.com/api/articles?limit=2",sbResponseBody);
    if (success == false) {
        wprintf(L"%s\n",http.lastErrorText());
        return;
    }

    CkJsonObjectW jResp;
    jResp.LoadSb(sbResponseBody);
    jResp.put_EmitCompact(false);

    wprintf(L"Response Body:\n");
    wprintf(L"%s\n",jResp.emit());
    }