Sample code for 30+ languages & platforms
Lua

Shopware Digest Authentication

See more Shopware Examples

Demonstrates using Digest access authentication for Shopware.

Chilkat Lua Downloads

Lua
local chilkat = require("chilkat")

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

local http = chilkat.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.digest_auth = true

local sbResponseBody = chilkat.StringBuilder.new()
local success = http:quick_get_sb("https://my-shopware-shop.com/api/articles?limit=2", sbResponseBody)
if not success then
    print(http.last_error_text)
    return
end

local jResp = chilkat.JsonObject.new()
jResp:load_sb(sbResponseBody)
jResp.emit_compact = false

print("Response Body:")
print(jResp:emit())