Sample code for 30+ languages & platforms
Go

Shopware Digest Authentication

See more Shopware Examples

Demonstrates using Digest access authentication for Shopware.

Chilkat Go Downloads

Go
    success := false

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

    http := chilkat.NewHttp()

    // To use HTTP Digest Authentication, set the login and password, and also indicate that DigestAuth should be used.
    http.SetLogin("api_username")
    http.SetPassword("api_key")
    http.SetDigestAuth(true)

    sbResponseBody := chilkat.NewStringBuilder()
    success = http.QuickGetSb("https://my-shopware-shop.com/api/articles?limit=2",sbResponseBody)
    if success == false {
        fmt.Println(http.LastErrorText())
        http.DisposeHttp()
        sbResponseBody.DisposeStringBuilder()
        return
    }

    jResp := chilkat.NewJsonObject()
    jResp.LoadSb(sbResponseBody)
    jResp.SetEmitCompact(false)

    fmt.Println("Response Body:")
    fmt.Println(*jResp.Emit())

    http.DisposeHttp()
    sbResponseBody.DisposeStringBuilder()
    jResp.DisposeJsonObject()