Returns the tags associated with an object. This example gets the tags for the object named "starfish.jpg" located in the bucket "chilkat100".
curl -X GET https://chilkat100.s3.amazonaws.com/starfish.jpg?tagging
Dim rest As New Chilkat.Rest
Dim success As Boolean
Dim authAws As New Chilkat.AuthAws
authAws.AccessKey = "AWS_ACCESS_KEY"
authAws.SecretKey = "AWS_SECRET_KEY"
authAws.Region = "us-east-1"
authAws.ServiceName = "s3"
rest.SetAuthAws(authAws)
// URL: https://chilkat100.s3.amazonaws.com/starfish.jpg?tagging
Dim bTls As Boolean
bTls = True
Dim port As Int32
port = 443
Dim bAutoReconnect As Boolean
bAutoReconnect = True
success = rest.Connect("chilkat100.s3.amazonaws.com",port,bTls,bAutoReconnect)
If (success <> True) Then
System.DebugLog("ConnectFailReason: " + Str(rest.ConnectFailReason))
System.DebugLog(rest.LastErrorText)
Return
End If
Dim sbResponseBody As New Chilkat.StringBuilder
success = rest.FullRequestNoBodySb("GET","/starfish.jpg?tagging",sbResponseBody)
If (success <> True) Then
System.DebugLog(rest.LastErrorText)
Return
End If
Dim respStatusCode As Int32
respStatusCode = rest.ResponseStatusCode
If (respStatusCode >= 400) Then
System.DebugLog("Response Status Code = " + Str(respStatusCode))
System.DebugLog("Response Header:")
System.DebugLog(rest.ResponseHeader)
System.DebugLog("Response Body:")
System.DebugLog(sbResponseBody.GetAsString())
Return
End If
Dim xmlResponse As New Chilkat.Xml
xmlResponse.LoadSb(sbResponseBody,True)
// See the Online Tool for Generating XML Parse Code
Dim Tagging_xmlns As String
Dim i As Int32
Dim count_i As Int32
Dim tagPath As String
Dim Key As String
Dim Value As String
Tagging_xmlns = xmlResponse.GetAttrValue("xmlns")
i = 0
count_i = xmlResponse.NumChildrenHavingTag("TagSet|Tag")
While i < count_i
xmlResponse.I = i
Key = xmlResponse.GetChildContent("TagSet|Tag[i]|Key")
Value = xmlResponse.GetChildContent("TagSet|Tag[i]|Value")
i = i + 1
Wend
<?xml version="1.0" encoding="UTF-8" ?>
<Tagging xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<TagSet>
<Tag>
<Key>habitat</Key>
<Value>ocean</Value>
</Tag>
<Tag>
<Key>phylum</Key>
<Value>Echinodermata</Value>
</Tag>
<Tag>
<Key>animal</Key>
<Value>starfish</Value>
</Tag>
</TagSet>
</Tagging>