Sample code for 30+ languages & platforms
Perl

Shopware Digest Authentication

See more Shopware Examples

Demonstrates using Digest access authentication for Shopware.

Chilkat Perl Downloads

Perl
use strict;
use warnings;
use Chilkat2;

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

my $http = Chilkat2::Http->new;

# To use HTTP Digest Authentication, set the login and password, and also indicate that DigestAuth should be used.
$http->Login('api_username');
$http->Password('api_key');
$http->DigestAuth(1);

my $sbResponseBody = Chilkat2::StringBuilder->new;
my $success = $http->QuickGetSb('https://my-shopware-shop.com/api/articles?limit=2', $sbResponseBody);
if (!$success) {
    print $http->LastErrorText, "\n";
    exit;
}

my $jResp = Chilkat2::JsonObject->new;
$jResp->LoadSb($sbResponseBody);
$jResp->EmitCompact(0);

print "Response Body:\n";
print $jResp->Emit(), "\n";