(Go) Example: Http.QuickGetSb method
Demonstrates the QuickGetSb method.
success := false
http := Http_Ref.html">chilkat.NewHttp()
// Send the HTTP GET and return the content in a StringBuilder_Ref.html">StringBuilder
sb := StringBuilder_Ref.html">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()
|