Lianja
Lianja
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 Lianja Downloads
llSuccess = .F.
loRest = createobject("CkRest")
llBTls = .T.
llBAutoReconnect = .T.
llSuccess = loRest.Connect("example.com",443,llBTls,llBAutoReconnect)
if (llSuccess = .F.) then
? loRest.LastErrorText
release loRest
return
endif
// Build a part.
loRest.PartSelector = "1"
llSuccess = loRest.SetMultipartBodyString("value1")
if (llSuccess = .F.) then
? loRest.LastErrorText
release loRest
return
endif
// Remove all multipart subparts from the request under construction, for example before reusing the
// same Rest object for a different multipart request.
loRest.ClearAllParts()
? "All multipart parts cleared."
release loRest