Sample code for 30+ languages & platforms
Xojo Plugin

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 Xojo Plugin Downloads

Xojo Plugin
Dim success As Boolean
success = False

Dim rest As New Chilkat.Rest
Dim bTls As Boolean
bTls = True
Dim bAutoReconnect As Boolean
bAutoReconnect = True
success = rest.Connect("example.com",443,bTls,bAutoReconnect)
If (success = False) Then
    System.DebugLog(rest.LastErrorText)
    Return
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
    System.DebugLog(rest.LastErrorText)
    Return
End If

Dim responseText As String
responseText = sbResponse.GetAsString()
If (sbResponse.LastMethodSuccess = False) Then
    System.DebugLog(sbResponse.LastErrorText)
    Return
End If

System.DebugLog(responseText)