VB.NET
VB.NET
Example: Http.QuickGetStr method
Demonstrates theQuickGetStr method.
Chilkat VB.NET Downloads
Dim http As New Chilkat.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.
Debug.WriteLine(http.LastErrorText)
Else
Debug.WriteLine("Response status code: " & http.LastStatus)
Debug.WriteLine("Response body error text:")
Debug.WriteLine(http.LastResponseBody)
End If
Exit Sub
End If
Debug.WriteLine(str)
Debug.WriteLine("Success")