Interface Specifications
Request response format standard
- For HTTP requests, use camelCase with the first letter lowercase for Querystring parameter keys, such as uploadId and partNumber.
- All user-defined meta must be placed in the header in the format of
x-bce-meta-*, and the total size of custom Meta must not exceed 2 K. The Key ofx-bce-meta-*will be uniformly processed in lowercase by the Server.
For example: If a user uploads x-bce-meta-DeMo:value using the PutObject API, the Server will uniformly process it as lowercase x-bce-meta-demo:value. When the user uses the GetObject API, the return value from the Server will be x-bce-meta-demo:value.
- In addition to the standard Header specified in RFC 2616, other Headers are defined in the format of
x-bce-*. - The RESTful APIs of BOS support only the JSON format.
- In all JSON data, keys must follow the camelCase convention with the first letter lowercase.
- Each request response includes the two Headers:
x-bce-request-idandx-bce-debug-id. - Header fields like date, content-MD5, content-Type, and content-length must comply with the rules of RFC 2616.
-
In accordance with the provisions of the HTTP protocol, content-MD5 requires both MD5 calculation and Base64 encoding. Its calculation method is as follows:
Content-MD5 = "Content-MD5" ":" md5-digest md5-digest = <base64 of 128 bit MD5 digest as per RFC 1864>
Common request headers
| Name | Types | Description |
|---|---|---|
| Authorization | String | Certification information for verifying the validity of the request. For more details, see Authentication |
| Content-Length | String | The HTTP request content length is defined by RFC 2616. |
| Content-Type | String | The HTTP request content type is defined by RFC 2616. |
| Content-MD5 | String | The MD5 digest of the HTTP request content, as defined in RFC 2616, verifies data consistency between the file stored in BOS and the one expected by the user. |
| Date | String | The GMT time specified in the HTTP 1.1 protocol, such as Wed, 06 Apr 2016 06:34:40 GMT. |
| Host | String | The access host value, which is BucketName.bj.baidubce.com. |
| x-bce-date | String | The current time, following the ISO 8601 standard, with a format like 2016-04-06T08:23:49Z. |
Common response headers
| Name | Types | Description |
|---|---|---|
| Content-Length | String | The HTTP request content length is defined by RFC 2616. |
| Content-Type | String | The HTTP request content type is defined by RFC 2616. |
| Content-MD5 | String | The MD5 digest of the HTTP request content, as defined in RFC 2616, verifies data consistency between the file stored in BOS and the one expected by the user. |
| Connection | String | Whether the server disconnects, with values being close or keep-alive. |
| Date | String | The GMT time specified in the HTTP 1.1 protocol, such as Wed, 06 Apr 2016 06:34:40 GMT. |
| eTag | String | The HTTP entity tag (eTag) identifies object content. Each time an object is created, an eTag is generated, which can be used to verify if the object's content has changed. |
| Server | String | The name of the server, with the value being BceBos. |
| x-bce-request-id | String | BCE BOS generates a unique identifier for requesting BceBos. |
| x-bce-debug-id | String | Created by BCE BOS, this identifier ID is used for troubleshooting. If issues arise when using BOS, you can provide this field in support tickets to speed up problem resolution. |
Differences in APIs for different storage types
The storage class of a file is based on the object. APIs for infrequent access storage, cold storage, and archive storage add a storage class attribute to the object. Storage class values include STANDARD, STANDARD_IA (infrequent access), COLD, and ARCHIVE, representing standard storage, infrequent access storage, cold storage, and archive storage respectively.
The following APIs for infrequent access/cold storage/archive storage add the storage class attribute, among which the archive storage class does not support the AppendObject API:
- The PutObject, InitiateMultipartUpload, CopyObject, AppendObject, and PostObject APIs include the storage class attribute parameter x-bce-storage-class in the request header.
Request headers
1 <br>
2
3<table>
STANDARD, STANDARD_IA,COLD and ARCHIVE.STANDARD.-
The GetObject and GetObjectMeta APIs return x-bce-storage-class in the response header.
Response headers
Name Types Description x-bce-storage-class String Storage class of BOS objects. Currently, the supported types are STANDARD,STANDARD_IA,COLDandARCHIVE.
For objects in archive storage that are being restored or have been restored, GetObjectMeta includes the header field "x-bce-restore" to indicate the restoration status.
-
The ListObjects, ListMultipartUploads, and ListParts APIs include storageClass in their response elements.
Response element
Name Types Description storageClass String Storage class of BOS objects. Currently, the supported types are STANDARD,STANDARD_IA,COLDandARCHIVE.
