You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The high level function put_object_tagging is calling the low level PUT function incorrectly.
It's forming the Tagging payload as part of the uri, when the S3 API is expecting it as XML in the body.
Here's what I did with the low level PUT function to get it working:
"""
_tagging_payload(tags::AbstractDict)
Forms the PUT XML body for the S3 object tagging API.
"""
function _tagging_payload(tags::AbstractDict)
payload = ""
for (k, v) in tags
payload *= """
<Tag>
<Key>$k</Key>
<Value>$v</Value>
</Tag>
"""
end
return """
<Tagging>
<TagSet>
$payload
</TagSet>
</Tagging>
"""
end
"""
put_object_tags(bucket, key, tags::AbstractDict)
Add or overwrites existing S3 object's tags.
"""
function put_object_tags(bucket, key, tags::AbstractDict; aws_config=global_aws_config())
existings_tags = get_object_tags(bucket, key; aws_config=aws_config)
merge!(existings_tags, tags)
AWSServices.s3("PUT", "/$(bucket)/$(key)?tagging", Dict("body" => _tagging_payload(existings_tags)); aws_config=aws_config)
end
The text was updated successfully, but these errors were encountered:
The high level function
put_object_tagging
is calling the low level PUT function incorrectly.It's forming the
Tagging
payload as part of the uri, when the S3 API is expecting it as XML in the body.Here's what I did with the low level PUT function to get it working:
The text was updated successfully, but these errors were encountered: