(Tcl) S3 Delete Multiple Objects
Demonstrates how to delete multiple objects in a single HTTP request.
load ./chilkat.dll
# This example requires the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.
set http [new_CkHttp]
# Insert your access key here:
CkHttp_put_AwsAccessKey $http "ABQXXABC83ABCDEFVQXX"
# Insert your secret key here:
CkHttp_put_AwsSecretKey $http "XXXXYYYYabcdABCD12345678xxxxyyyyzzzz"
set bucketName "chilkattestbucket"
set objectName1 "starfish.jpg"
# Delete a particular version of this object:
set objectName2 "conch.jpg; VersionId=\"3/L4kqtJlcpXroDTDmJ+rmSpXd3dIbrHY+MTRCxf3vjVBH40Nr8X8gdRQBpUMLUo\""
set objectName3 "seaUrchin.jpg"
set sa [new_CkStringArray]
CkStringArray_Append $sa $objectName1
CkStringArray_Append $sa $objectName2
CkStringArray_Append $sa $objectName3
# resp is a CkHttpResponse
set resp [CkHttp_S3_DeleteMultipleObjects $http $bucketName $sa]
if {[CkHttp_get_LastMethodSuccess $http] == 0} then {
puts [CkHttp_lastErrorText $http]
delete_CkHttp $http
delete_CkStringArray $sa
exit
}
# Display the JSON response.
puts [CkHttpResponse_bodyStr $resp]
delete_CkHttpResponse $resp
delete_CkHttp $http
delete_CkStringArray $sa
|