Sample code for 30+ languages & platforms
Classic ASP

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 Classic ASP Downloads

Classic ASP
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
success = 0

set rest = Server.CreateObject("Chilkat.Rest")
bTls = 1
bAutoReconnect = 1
success = rest.Connect("example.com",443,bTls,bAutoReconnect)
If (success = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( rest.LastErrorText) & "</pre>"
    Response.End
End If

'  Build a part.
rest.PartSelector = "1"
success = rest.SetMultipartBodyString("value1")
If (success = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( rest.LastErrorText) & "</pre>"
    Response.End
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()

Response.Write "<pre>" & Server.HTMLEncode( "All multipart parts cleared.") & "</pre>"

%>
</body>
</html>