Sample code for 30+ languages & platforms
B4X

Example: Http.QuickGetSb method

Demonstrates the QuickGetSb method.

Chilkat B4X Downloads

B4X
Dim success As Boolean = False

Dim http As ChilkatHttp
http.Initialize("http")

'  Send the HTTP GET and return the content in a StringBuilder
Dim sb As ChilkatStringBuilder
sb.Initialize
success = http.QuickGetSb("https://www.chilkatsoft.com/helloWorld.json", sb)
If http.LastMethodSuccess = False Then
    If http.LastStatus = 0 Then
        '  Communications error.  We did not get a response.
        Log(http.LastErrorText)
    Else
        Log("Response status code: " & http.LastStatus)
        Log("Response body error text:")
        Log(sb.GetAsString)
    End If

    Return
End If


'  The downloaded content:
Log(sb.GetAsString)
Log("Success")