B4X
B4X
Example: Http.QuickGetStr method
Demonstrates theQuickGetStr method.
Chilkat B4X Downloads
Dim http As ChilkatHttp
http.Initialize("http")
' Keep the response body if there's an error.
http.KeepResponseBody = True
' Send the HTTP GET and return the content in a string.
Dim str As String = http.QuickGetStr("https://www.chilkatsoft.com/helloWorld.json")
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(http.LastResponseBody)
End If
Return
End If
Log(str)
Log("Success")