Sample code for 30+ languages & platforms
Go

Example: Http.QuickGetSb method

Demonstrates the QuickGetSb method.

Chilkat Go Downloads

Go
    success := false

    http := chilkat.NewHttp()

    // Send the HTTP GET and return the content in a StringBuilder
    sb := chilkat.NewStringBuilder()
    success = http.QuickGetSb("https://www.chilkatsoft.com/helloWorld.json",sb)
    if http.LastMethodSuccess() == false {
        if http.LastStatus() == 0 {
            // Communications error.  We did not get a response.
            fmt.Println(http.LastErrorText())
        } else {
            fmt.Println("Response status code: ", http.LastStatus())
            fmt.Println("Response body error text:")
            fmt.Println(*sb.GetAsString())
        }

        http.DisposeHttp()
        sb.DisposeStringBuilder()
        return
    }

    // The downloaded content:
    fmt.Println(*sb.GetAsString())
    fmt.Println("Success")

    http.DisposeHttp()
    sb.DisposeStringBuilder()