• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. API Reference (OBS)
  4. Operations on Buckets
  5. PUT Bucket CORS
  6. Examples

Examples

Sample Request

PUT /?cors HTTP/1.1 
 User-Agent: curl/7.19.0 (x86_64-suse-linux-gnu) libcurl/7.19.0 OpenSSL/0.9.8{ zlib/1.2.3 libidn/1.10 
 Host: bucketname.obs.example.com
 Accept: */* 
 Date: Tue, 28 Apr 2015 08:56:07 +0000 
 Authorization:  AWS D13E0C94E722DD69423C:QhHpU6Amg/2r6wIYdU3RXIx7Tlc= 
 Content-MD5: x3R4DBZgOrwsI6DwztrQCg== 
 Content-Length: 468
<CORSConfiguration> 
   <CORSRule> 
     <AllowedMethod>POST</AllowedMethod> 
     <AllowedMethod>GET</AllowedMethod> 
     <AllowedMethod>HEAD</AllowedMethod> 
     <AllowedMethod>PUT</AllowedMethod> 
     <AllowedMethod>DELETE</AllowedMethod> 
     <AllowedOrigin>obs.example.com</AllowedOrigin>
     <AllowedOrigin>www.example.com</AllowedOrigin> 
     <AllowedHeader>AllowedHeader_1</AllowedHeader> 
     <AllowedHeader>AllowedHeader_2</AllowedHeader> 
     <MaxAgeSeconds>100</MaxAgeSeconds> 
     <ExposeHeader>ExposeHeader_1</ExposeHeader> 
     <ExposeHeader>ExposeHeader_2</ExposeHeader> 
   </CORSRule> 
 </CORSConfiguration>

Sample Response

HTTP/1.1 200 OK
 Server: OBS 
 x-amz-request-id: C2D2F581B3C5AF6C6698322AB56836F6 
 x-amz-id-2: lDGZAj4h+A33eYauDCTsPvFSHzBXEtZon6Eg1idIZl18/2/odotyqJUJ/lTh80uA 
 x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
 Date: Tue, 28 Apr 2015 08:56:07 GMT
 Content-Length: 0