PostObject

Last update:2025-08-18 15:51:54

Upload data using a form-based method, suitable for HTML forms, and it requires IAM wos:PutObject permissions.

Request syntax

POST / HTTP/1.1
Host: Bucket.Endpoint
Keep-Alive: 300
Connection: keep-alive
Content-Type: multipart/form-data; boundary=-9431149156168
Content-Length: length

--9431149156168
Content-Disposition: form-data; name=”key”
key
--9431149156168
Content-Disposition: form-data; name=”content-Type”
content_type
--9431149156168
Content-Disposition: form-data; name=”x-wos-meta-*”
x-wos-meta-*
--9431149156168
Content-Disposition: form-data; name=”content-MD5”
content_MD5
--9431149156168
Content-Disposition: form-data; name=”policy”
policy=
--9431149156168
Content-Disposition: form-data; name=”signature”
signature=
--9431149156168
Content-Disposition: form-data; name=”file”; filename=”MyFilename”
Content-Type: image/jpeg
fil_content
--9431149156168
Content-Disposition: form-data; name=”submit”
Upload to WCS
--9431149156168—

URI request parameters

None.

Request header

Please use Common Request Headers.

Form parameters

Parameter Description Required
key The name of the object created by this request. Yes
file Content of the object.
Type:Binary or text type
Restriction:Only one file parameter can be included in a request.
Yes
content-type MIMEtype, indicating the format of object content to upload. No
Content-MD5 The MD5 value of the object data to be uploaded. If the data is corrupted during transmission, a 403 SignatureDoesNotMatch error will be returned, indicating that the MD5 does not match the original value, and the upload will fail. No
x-wos-storage-class Specifies the storage class of the file. Supported values include: Standard (standard storage), IA (infrequent access storage), and Archive (archive storage). Defaults to the bucket’s storage class. No
x-wos-meta-* Custom metadata. This information will be returned as response headers when using headObject and getObject operations. No

Request body

Object Body

Response syntax


HTTP/1.1 status_code
x-wos-request-id: request id
Content-Type: type
Location: location
Date: date
ETag: etag
Server:WS-web-server

Response header

In addition to Common Response Headers, it also contains

Element name

description

Etag

Entity tag of uploaded data

Response body

None.

Example

POST /object HTTP/1.1
Date: Fri, 18 May 2017 01:19:49 GMT
Host: bucket.s3-cn-east-1.wcsapi.com
Content-Type: multipart/form-data; boundary=---------------------------7db143f50da2
Content-Length: 2424
Content-Disposition: form-data; name="AWSAccessKeyId"
94963ba9c9ebb26620acf4d8aac40b72c5706c6a
-----------------------------7db143f50da2
Content-Disposition: form-data; name="key"
object01
-----------------------------7db143f50da2
Content-Disposition: form-data; name="acl"
public-read
-----------------------------7db143f50da2
Content-Disposition: form-data; name="content-type"
text/plain
-----------------------------7db143f50da2
Content-Disposition: form-data; name="policy"
eyJjb25kaXRpb25zIjogW3siYWNsIjogInB1YmxpYy1yZWFkIn0sIHsiYnVja2V0IjogIndzdGVzdC0yIn0sIHsia2V5IjogInYydDEudHh0In0sIFsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAxMDQ4NTc5LCAxMDQ4NTc2MF1dLCAiZXhwaXJhdGlvbiI6ICIyMDE3LTEyLTEzVDA3OjU0OjU5LjEzWiJ9
-----------------------------7db143f50da2
Content-Disposition: form-data; name="signature"
+c+e164E4cZ7J1WEVp/BKEI91bs=
-----------------------------7db143f50da2
Content-Disposition: form-data; name="file"; filename="C:\Testtools\UpLoadFiles\object
\1024Bytes.txt"
Content-Type: text/plain
01234567890
-----------------------------7db143f50da2

HTTP/1 100 Continue
HTTP/1 200 OK
x-wos-request-id: 90E2BA00C26C00000133B442A90063FD
Date: Fri, 18 May 2017 01:20:27 GMT
ETag: "ab7abb0da4bca5323ab6119bb5dcd296"
Content-Length: 0
Connection: close
Server: WS-Web-Server

Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!