Sample code for 30+ languages & platforms
Visual Basic 6.0

Clear All Multipart Parts

See more REST Examples

Demonstrates Rest.ClearAllParts, which removes all multipart subparts from the request under construction.

Background. Clearing the parts is useful when reusing the same Rest object to build a different multipart request.

Chilkat Visual Basic 6.0 Downloads

Visual Basic 6.0
Dim success As Long
success = 0

Dim rest As New ChilkatRest
Dim bTls As Long
bTls = 1
Dim bAutoReconnect As Long
bAutoReconnect = 1
success = rest.Connect("example.com",443,bTls,bAutoReconnect)
If (success = 0) Then
    Debug.Print rest.LastErrorText
    Exit Sub
End If

'  Build a part.
rest.PartSelector = "1"
success = rest.SetMultipartBodyString("value1")
If (success = 0) Then
    Debug.Print rest.LastErrorText
    Exit Sub
End If

'  Remove all multipart subparts from the request under construction, for example before reusing the
'  same Rest object for a different multipart request.
success = rest.ClearAllParts()

Debug.Print "All multipart parts cleared."