Sample code for 30+ languages & platforms
Lianja

Example: Http.QuickGetSb method

Demonstrates the QuickGetSb method.

Chilkat Lianja Downloads

Lianja
llSuccess = .F.

loHttp = createobject("CkHttp")

// Send the HTTP GET and return the content in a StringBuilder
loSb = createobject("CkStringBuilder")
llSuccess = loHttp.QuickGetSb("https://www.chilkatsoft.com/helloWorld.json",loSb)
if (loHttp.LastMethodSuccess = .F.) then
    if (loHttp.LastStatus = 0) then
        // Communications error.  We did not get a response.
        ? loHttp.LastErrorText
    else
        ? "Response status code: " + str(loHttp.LastStatus)
        ? "Response body error text:"
        ? loSb.GetAsString()
    endif

    release loHttp
    release loSb
    return
endif

// The downloaded content:
? loSb.GetAsString()
? "Success"


release loHttp
release loSb