Sample code for 30+ languages & platforms
Swift

Shopware Digest Authentication

See more Shopware Examples

Demonstrates using Digest access authentication for Shopware.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    var success: Bool = false

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

    let http = CkoHttp()!

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

    let sbResponseBody = CkoStringBuilder()!
    success = http.quickGetSb(url: "https://my-shopware-shop.com/api/articles?limit=2", sbContent: sbResponseBody)
    if success == false {
        print("\(http.lastErrorText!)")
        return
    }

    let jResp = CkoJsonObject()!
    jResp.loadSb(sb: sbResponseBody)
    jResp.emitCompact = false

    print("Response Body:")
    print("\(jResp.emit()!)")

}