(Xojo Plugin) Example: Http.DownloadSb method
Demonstrates the DownloadSb method.
Dim success As Boolean
success = False
Dim http As New Chilkat.Http
http.KeepResponseBody = True
Dim sb As New Chilkat.StringBuilder
success = http.DownloadSb("https://chilkatsoft.com/testData/helloWorld.txt","utf-8",sb)
Dim statusCode As Int32
statusCode = http.LastStatus
If (success = False) Then
If (statusCode = 0) Then
// Unable to either send the request or get the response.
System.DebugLog(http.LastErrorText)
Else
// We got a response, but the status code was not in the 200s
System.DebugLog("Response status code: " + Str(statusCode))
// Examine the response body.
System.DebugLog("Response body:")
System.DebugLog(http.LastResponseBody)
End If
System.DebugLog("Download failed.")
Else
System.DebugLog("Download success, response status = " + Str(statusCode))
System.DebugLog(sb.GetAsString())
End If
|