• Object Storage Service

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

Examples

Sample Request

PUT /object02 HTTP/1.1 
 User-Agent: Jakarta Commons-HttpClient/3.1 
 Host: bucketname.obs.example.com
 Accept: */* 
 Date: Sat, 03 Dec 2011 07:12:31 +0000 
 Authorization: AWS BF6C09F302931425E9A7:KUxrlwKGWYpUOTgwNxIHALsRdT4= 
 x-amz-meta-key: value 
 Content-Length: 256 

 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456

Sample Request for Redirecting Object Location

PUT /object02 HTTP/1.1
User-Agent: Jakarta Commons-HttpClient/3.1
Host: bucketname.obs.example.com
Accept: */*
Date: Sat, 03 Dec 2011 07:12:31 +0000
Authorization: AWS BF6C09F302931425E9A7:KUxrlwKGWYpUOTgwNxIHALsRdT4=
x-amz-meta-key: value
Content-Length: 256
x-amz-website-redirect-location: www.example.com
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456

Sample Response for Uploading Objects to a Bucket with No Versioning Configured

HTTP/1.1 200 OK 
 Server: OBS 
 x-amz-request-id: 001B21A61C6C0000013402C4616D5285 
 x-amz-id-2: MDAxQjIxQTYxQzZDMDAwMDAxMzQwMkM0NjE2RDUyODVBQUFBQUFBQWJiYmJiYmJi 
 x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon 
 Technologies, Inc 
 Content-Type: text/xml 
 ETag: "33bee59f4c1f859a7aedd36779b321cf" 
 Date: Sat, 03 Dec 2011 07:12:31 GMT 
 Content-Length: 0

Sample Response for Uploading Objects to a Bucket with Versioning Enabled

HTTP/1.1 200 OK 
 Server: OBS 
 x-amz-request-id: DCD2FC9CAB78000001438AB633CF1A73 
 x-amz-id-2: zvOE6GmblPrMk544Fg7BEt4LAmwdRuPx5s2qDVeGHZZJhUMmdxKsW4MzeJLkoVvX 
 x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc 
 Content-Type: text/xml 
 ETag: "ba1f2511fc30423bdbb183fe33f3dd0f" 
 x-amz-version-id: AAABQ4q2M9_c0vycq3gAAAAAVURTRkha 
 Date: Mon, 13 Jan 2014 08:27:13 GMT 
 Content-Length: 0

Sample Response for Uploading Objects to a Bucket with Versioning Suspended

HTTP/1.1 200 OK 
 Server: OBS 
 x-amz-request-id: DCD2FC9CAB78000001439A51DB2B2577 
 x-amz-id-2: GcVgfeOJHx8JZHTHrRqkPsbKdB583fYbr3RBbHT6mMrBstReVILBZbMAdLiBYy1l 
 x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc 
 Content-Type: text/xml 
 ETag: "0b55edbacf50d5086ea83ee08e55cbbd" 
 Date: Thu, 13 Jan 2014 09:11:32 GMT 
 Content-Length: 0