(Lianja) 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.
loHttp = createobject("CkHttp")
// To use HTTP Digest Authentication, set the login and password, and also indicate that DigestAuth should be used.
loHttp.Login = "api_username"
loHttp.Password = "api_key"
loHttp.DigestAuth = .T.
loSbResponseBody = createobject("CkStringBuilder")
llSuccess = loHttp.QuickGetSb("https://my-shopware-shop.com/api/articles?limit=2",loSbResponseBody)
if (llSuccess = .F.) then
? loHttp.LastErrorText
release loHttp
release loSbResponseBody
return
endif
loJResp = createobject("CkJsonObject")
loJResp.LoadSb(loSbResponseBody)
loJResp.EmitCompact = .F.
? "Response Body:"
? loJResp.Emit()
release loHttp
release loSbResponseBody
release loJResp
|