Dart
Dart
Shopware Digest Authentication
See more Shopware Examples
Demonstrates using Digest access authentication for Shopware.Chilkat Dart Downloads
import 'package:chilkat/chilkat.dart';
void main() {
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
final http = CkHttp();
// 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 = true;
final sbResponseBody = CkStringBuilder();
try {
http.quickGetSb('https://my-shopware-shop.com/api/articles?limit=2', sbResponseBody);
} on ChilkatException catch (e) {
print(e.lastErrorText);
return;
}
final jResp = CkJsonObject();
jResp.loadSb(sbResponseBody);
jResp.emitCompact = false;
print('Response Body:');
print(jResp.emit());
}