Example: PUT bucket request

Content Platform Tenant Management Help

Version
9.7.x
File Size
4269 KB
Audience
anonymous
Part Number
MK-95HCPH002-19

The following PUT bucket request adds a CORS subresource to a bucket (namespace) named finance.

Note: Each S3 compatible request must be authenticated by the S3 gateway. You do this by using the HTTP Authorization request header with either a signature string, an AWS Version 2 or Version 4 authentication string, or by anonymous access.

Request headers

PUT /?cors HTTP/1.1
Host:finance.europe.hcp.example.com
x-amz-date: Tue, 14 May 2019 17:54:50 GMT
Content-MD5: 8dYiLewFWZyGgV2Q5FNI4W==
Authorization: SignatureString

Request body

<CORSConfiguration>
     <CORSRule>
          <AllowedOrigin>http://www.example.com</AllowedOrigin>
          <AllowedMethod>PUT</AllowedMethod>
          <AllowedMethod>POST</AllowedMethod>
          <AllowedMethod>DELETE</AllowedMethod>
          <AllowedHeader>*</AllowedHeader>
          <MaxAgeSeconds>3000</MaxAgeSec>
          <ExposeHeader>ETag</ExposeHeader>
     </CORSRule>
     <CORSRule>
          <AllowedOrigin>*</AllowedOrigin>
          <AllowedMethod>GET</AllowedMethod>
          <AllowedHeader>*</AllowedHeader>
          <MaxAgeSeconds>3000</MaxAgeSeconds>
     </CORSRule>
</CORSConfiguration>

Response headers

HTTP/1.1 200 OK
Date: Tue, 14 May 2019 17:54:50 GMT
Server: HCP