• Object Storage Service

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

Examples

Sample Request

GET /?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 09:11:35 +0000 
 Authorization: AWS D13E0C94E722DD69423C:FJt2xJ1gEnozLSdpRNTJUoy6344=

Sample Response

HTTP/1.1 200 OK 
 Server: OBS
 x-amz-request-id: C2D7CDD617B33354C3AA227BF2077071 
 x-amz-id-2: xO3n8Q4eiJKCeAtG6U4nCSnDzhbBbMhgln8fcrOFYVGRJMc8KK/puQyr5bbSdjBU 
 x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc 
 Content-Type: application/xml 
 Date: Tue, 28 Apr 2015 09:11:35 GMT 
 Content-Length: 556 

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
 <CORSConfiguration xmlns="http://obs.example.com/doc/2015-06-30/"> 
 <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>