PutObjectTagging
更新时间:2024-05-16
接口描述
此接口用于向指定的object上传对象标签,目前BOS支持两种方式设置对象标签。在PutObjectTagging的时候,通过头域的"x-bce-tagging"来设置object对象标签,第二种方式是上传一个TAG文件。
请求(Request)
-
TAG文件请求语法
PUT /<ObjectKey>?tagging HTTP/1.1 Host: <BucketName>.bj.bcebos.com x-bce-date: <Date> Authorization: <AuthorizationString> Content-Type: application/json; charset=utf-8 Content-Length: <ContentLength>
-
Canned TAG请求语法(设置x-bce-tagging)
PUT /<ObjectKey>?tagging HTTP/1.1 Host: <BucketName>.bj.bcebos.com x-bce-date: <Date> x-bce-tagging: <ObjectTag> Authorization: <AuthorizationString> Content-Length: <ContentLength> Content-Type: application/json; charset=utf-8
-
请求参数
无特殊参数
-
请求头域
名称 类型 描述 是否必需 x-bce-tagging String 用户自定义的对象标签 否 -
请求参数
无特殊参数
响应(Response)
示例
PUT /ObjectName?tagging HTTP/1.1
Host: BucketName.bj.bcebos.com
x-bce-date: 2017-05-01T12:23:49Z
x-bce-tagging: bos1=value1&bos2=values2
Authorization: AuthorizationString
Content-Type: application/json; charset=utf-8
Content-Length: 0
HTTP/1.1 200 OK
Date: Wed, 01 Mar 2017 12:25:00 GMT
Content-Length: 0
Server: BceBos
x-bce-request-id:413e34fd-118d-4049-b992-1b1f3a68b1f5
PUT /ObjectName?tagging HTTP/1.1
Host: BucketName.bj.bcebos.com
x-bce-date: 2017-05-01T12:23:49Z
Authorization: AuthorizationString
Content-Type: application/json; charset=utf-8
Content-Length: 315
{"tagSet":[{"tagInfo":[{"key":"key1","value":"value1"}, {"key":"key2","value":"value2"},{"key":"key3","value":"value3"}]}]}
HTTP/1.1 200 OK
Date: Wed, 01 Mar 2017 12:25:00 GMT
Content-Length: 0
Server: BceBos
x-bce-request-id:413e34fd-118d-4049-b992-1b1f3a68b1f5