Sample code for 30+ languages & platforms
Lianja

Shopware Digest Authentication

See more Shopware Examples

Demonstrates using Digest access authentication for Shopware.

Chilkat Lianja Downloads

Lianja
llSuccess = .F.

// 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