(AutoIt) Shopware Digest Authentication
Demonstrates using Digest access authentication for Shopware. For more information, see https://developers.shopware.com/developers-guide/rest-api/#digest-access-authentication
; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
$oHttp = ObjCreate("Chilkat.Http")
; To use HTTP Digest Authentication, set the login and password, and also indicate that DigestAuth should be used.
$oHttp.Login = "api_username"
$oHttp.Password = "api_key"
$oHttp.DigestAuth = True
$oSbResponseBody = ObjCreate("Chilkat.StringBuilder")
Local $bSuccess = $oHttp.QuickGetSb("https://my-shopware-shop.com/api/articles?limit=2",$oSbResponseBody)
If ($bSuccess = False) Then
ConsoleWrite($oHttp.LastErrorText & @CRLF)
Exit
EndIf
$oJResp = ObjCreate("Chilkat.JsonObject")
$oJResp.LoadSb($oSbResponseBody)
$oJResp.EmitCompact = False
ConsoleWrite("Response Body:" & @CRLF)
ConsoleWrite($oJResp.Emit() & @CRLF)
|