PUT Bucket Policy

You can perform this operation to create or modify a policy on a bucket. If the bucket already has a policy, the policy will be overwritten by the one specified in this request.

Only the bucket owner can create or modify the bucket policy.

Request Syntax

PUT /?policy HTTP/1.1  
Host: bucketname.obs.cn-north-1.myhwclouds.com
Date: date  
Authorization: signatureValue  

Policy written in JSON

Request Parameters

This request contains no parameter.

Request Headers

This request uses common headers. For details, see Common Request Headers.

Request Elements

The request body is a JSON string containing bucket policies. This JSON string is compatible with Amazon's.

Response Syntax

HTTP/1.1 status_code
Date: date
Content-Length: length

Response Headers

This response uses common headers. For details, see Common Response Headers.

Response Elements

This response contains no element.

Error Responses

No special error responses are returned. For details about error responses, see Table 1.