Sample code for 30+ languages & platforms
Tcl

S3 List Buckets

See more Amazon S3 Examples

Demonstrates how to retrieve the XML listing the buckets for an Amazon S3 account.

Chilkat Tcl Downloads

Tcl

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 "AWS_ACCESS_KEY"

# Insert your secret key here:
CkHttp_put_AwsSecretKey $http "AWS_SECRET_KEY"

set xmlStr [CkHttp_s3_ListBuckets $http]

if {[CkHttp_get_LastMethodSuccess $http] != 1} then {
    # Failed
    puts [CkHttp_lastErrorText $http]
} else {
    # Success.  Show the XML response.  (Use the online tool at the link below to generate parsing code.)
    puts "$xmlStr"
}

# Use this online tool to generate parsing code from sample XML: 
# Generate Parsing Code from XML

delete_CkHttp $http