Sample code for 30+ languages & platforms
VB.NET

Send a Bodyless REST Request into a StringBuilder

See more REST Examples

Demonstrates Rest.FullRequestNoBodySb, which sends a request with no body and stores the text response body in a StringBuilder.

Background. This variant of the no-body full request writes the response into a StringBuilder rather than returning it as a string, which is convenient when the response will be further processed in place.

Chilkat VB.NET Downloads

VB.NET
Dim success As Boolean = False

Dim rest As New Chilkat.Rest
Dim bTls As Boolean = True
Dim bAutoReconnect As Boolean = True
success = rest.Connect("example.com",443,bTls,bAutoReconnect)
If (success = False) Then
    Debug.WriteLine(rest.LastErrorText)
    Exit Sub
End If


'  FullRequestNoBodySb sends a request with no body and stores the text response body in a
'  StringBuilder.
Dim sbResponse As New Chilkat.StringBuilder
success = rest.FullRequestNoBodySb("GET","/api/items/123",sbResponse)
If (success = False) Then
    Debug.WriteLine(rest.LastErrorText)
    Exit Sub
End If


Dim responseText As String = sbResponse.GetAsString()
If (sbResponse.LastMethodSuccess = False) Then
    Debug.WriteLine(sbResponse.LastErrorText)
    Exit Sub
End If

Debug.WriteLine(responseText)