Updated on 2026-08-03 GMT+08:00

obs_response_handler

Table 1 obs_response_handler

Parameter

Type

Mandatory (Yes/No)

Description

properties_callback

obs_response_properties_callback *

Yes

Explanation:

Details about the request failure, including the error message and resource information. You are advised to record them in callback_data (custom callback data).

Restrictions:

None

Value range:

None

Default value:

None

complete_callback

obs_response_complete_callback *

Yes

Explanation:

The pointer to the completion callback function. The content of obs_status and obs_error_details in the callback can be recorded in callback_data (custom callback data).

Restrictions:

None

Value range:

None

Default value:

None

Table 2 obs_response_properties_callback

Parameter

Type

Mandatory (Yes/No)

Description

properties

const obs_response_properties*

Yes

Explanation:

Parameters in the response headers. You are advised to record them to callback_data (custom callback data).

Restrictions:

None

Value range:

None

Default value:

None

callback_data

void *

Yes

Explanation:

The pointer to the custom callback data.

Restrictions:

None

Value range:

None

Default value:

None

Table 3 obs_response_complete_callback

Parameter

Type

Mandatory (Yes/No)

Description

status

obs_status

Yes

Explanation:

Internal request status code of the SDK.

Restrictions:

None

Value range:

None

Default value:

None

error_details

const obs_error_details*

Yes

Explanation:

Details about the request failure, including the error message and resource information. You are advised to record them in callback_data (custom callback data).

Restrictions:

None

Value range:

None

Default value:

None

callback_data

void *

Yes

Explanation:

The pointer to the custom callback data.

Restrictions:

None

Value range:

None

Default value:

None

Table 4 obs_response_properties

Parameter

Type

Mandatory (Yes/No)

Description

request_id

const char *

No

Explanation:

The value created by OBS to uniquely identify the request. OBS uses this value to locate the fault.

Restrictions:

None

Value range:

None

Default value:

None

request_id2

const char *

No

Explanation:

A special symbol that helps troubleshoot.

Restrictions:

None

Value range:

None

Default value:

None

content_type

const char *

No

Explanation:

MIME type of the object. MIME type is a standard way of describing a data type and is used by the browser to decide how to display data.

Restrictions:

None

Value range:

None

Default value:

None

content_length

uint64_t

No

Explanation:

The size (in bytes) of the response body.

Restrictions:

None

Value range:

None

Default value:

None

server

const char *

No

Explanation:

Server header in a request.

Restrictions:

None

Value range:

None

Default value:

None

etag

const char *

No

Explanation:

Base64-encoded, 128-bit MD5 value of an object. It uniquely identifies the content of an object and can be used to check the object integrity. For example, if the ETag is A when an object is uploaded and is B when the object is downloaded, it indicates that the object content has been changed. The ETag reflects changes to the contents of the object, not its metadata. An object created by an upload or copy operation has a unique ETag.

Restrictions:

If an object is encrypted using server-side encryption, the ETag is not the MD5 value of the object.

Value range:

The value must contain 32 characters.

Default value:

None

expiration

const char *

No

Explanation:

Expiration details of the object.

Restrictions:

None

Value range:

An integer greater than 0, in days.

Default value:

None

website_redirect_location

const char *

No

Explanation:

Indicates where an object request is redirected. If the bucket that contains the object is configured with Website settings, this parameter can be set in the object metadata so that the request for the object can be redirected to another object in the same bucket or an external URL after the website returns a 301 redirect response.

To another object in the same bucket:

x-obs-website-redirect-location:/anotherPage.html

To an external URL:

x-obs-website-redirect-location:http://www.example.com/

OBS obtains the specified value from the header and stores it in the object metadata WebsiteRedirectLocation.

Restrictions:

  • The value must start with a slash (/), http://, or https:// and cannot exceed 2 KB.
  • OBS only supports redirection of objects that are in the root directory.

Default value:

None

version_id

const char *

No

Explanation:

Object version ID. If the object has no version ID, the value is NULL.

Restrictions:

The value must contain 32 characters.

Value range:

None

Default value:

None

meta_data_count

int

No

Explanation:

Number of elements in the meta_data array.

Restrictions:

None

Value range:

None

Default value:

None

meta_data

const obs_name_value *

No

Explanation:

Custom metadata of the object. You can add custom metadata headers that start with x-obs-meta- for easy object management. When you retrieve or query the metadata of the object, the added custom metadata headers will be returned in the response.

Restrictions:

None

Value range:

None

Default value:

None

use_server_side_encryption

char

No

Explanation:

If server-side encryption is enabled, this parameter is set to '\1'.

Restrictions:

None

Value range:

None

Default value:

None

allow_origin

const char *

No

Explanation:

Returned if the request origin meets the CORS configured on the server.

Restrictions:

None

Value range:

The value that complies with the CORS

Default value:

None

allow_headers

const char *

No

Explanation:

Returned if the request headers meet the CORS configured on the server.

Restrictions:

At most one asterisk (*) is allowed. Spaces, ampersands (&), colons (:), less-than signs (<), and full-width characters are not allowed.

Value range:

The value that complies with the CORS

Default value:

None

max_age

const char *

No

Explanation:

MaxAgeSeconds in the CORS rules of the bucket. It specifies the time your client can cache the response for a cross-origin request.

Restrictions:

Each CORS rule can contain at most one MaxAgeSeconds.

Value range:

An integer greater than or equal to 0, in seconds.

Default value:

3000

allow_methods

const char *

No

Explanation:

Indicates that methods in the rule are included in the response if Access-Control-Request-Method in the request meets the CORS configuration requirements when CORS is configured for buckets.

Restrictions:

None

Value range:

  • GET
  • PUT
  • HEAD
  • POST
  • DELETE

Default value:

None

expose_headers

const char *

No

Explanation:

ExposeHeader in the CORS rules of the bucket. It specifies additional headers allowed in the response by a CORS rule. These headers provide extra information to clients. By default, a browser can access only headers Content-Length and Content-Type. If the browser needs to access other headers, you need to configure them as additional headers.

Restrictions:

Spaces, asterisks (*), ampersands (&), colons (:), less-than signs (<), and full-width characters are not allowed.

Value range:

None

Default value:

None

storage_class

const char *

No

Explanation:

Object storage class.

Restrictions:

This header is returned only when the storage class of an object is not Standard.

Value range:

  • WARM (Infrequent Access storage class)
  • COLD (Archive storage class)

Default value:

None

server_side_encryption

const char *

No

Explanation:

The encryption method used by the server.

Example: x-obs-server-side-encryption:kms

Restrictions:

This header is included in a response if SSE-KMS is used.

Value range:

  • kms (SSE-KMS encryption)
  • obs (SSE-OBS encryption)

Default value:

None

kms_key_id

const char *

No

Explanation:

Key ID. If the SSE-KMS encryption is used with a specified key, the key ID is required.

Restrictions:

This header can only be used when you specify kms for the server_side_encryption header.

Default value:

If you specify kms for encryption but do not specify a key ID, the default master key will be used. If there is not a default master key, OBS will create one and use it.

customer_algorithm

const char *

No

Explanation:

Indicates a decryption algorithm. This header is included in a response if SSE-C is used.

Restrictions:

None

Value range:

AES256 (AES256 decryption algorithm)

Default value:

None

customer_key_md5

const char *

No

Explanation:

Indicates the MD5 value of a key used to decrypt objects. This header is included in a response if SSE-C is used.

Restrictions:

Base64-encoded MD5 value of the key, for example, 4XvB3tbNTN+tIEVa0/fGaQ==.

Value range:

Base64-encoded MD5 value of the key ID.

Default value:

None

bucket_location

const char *

No

Explanation:

Indicates the region where the bucket resides.

Restrictions:

None

Value range:

None

Default value:

None

obs_version

const char *

No

Explanation:

OBS version of the bucket.

Restrictions:

None

Value range:

  • 3.0: bucket of the latest version
  • --: bucket of an earlier version

Default value:

None

restore

const char *

No

Explanation:

Restoration status of an object.

Examples: ongoing-request="true" (the object is being restored); ongoing-request="false", expiry-date="Wed, 7 Nov 2012 00:00:00 GMT" (the object has been restored) expiry-date indicates when the restored object will expire.

Restrictions:

For an Archive object that is being restored or has been restored, this header is returned.

Value range:

None

Default value:

None

obs_object_type

const char *

No

Explanation:

Type of the object.

Restrictions:

This header is returned only when the object is not a Normal object.

Value range:

Appendable

Default value:

None

obs_next_append_position

const char *

No

Explanation:

Indicates the position to be provided for the next request.

Restrictions:

This header is returned only when the object is an Appendable object.

Value range:

None

Default value:

None

obs_head_epid

const char *

No

Explanation:

Enterprise project ID for the current bucket. Users who have enabled the enterprise project function can obtain the ID from the enterprise project service.

Restrictions:

The value is a UUID. This parameter is not required if you have not enabled an enterprise project.

Value range:

None

Default value:

None

reserved_indicator

const char *

No

Explanation:

A special symbol that helps troubleshoot.

Restrictions:

None

Value range:

None

Default value:

None

Table 5 obs_error_details

Parameter

Type

Mandatory (Yes/No)

Description

message

const char*

No

Explanation:

Error details in the XML error response body.

Restrictions:

None

Value range:

See Error Codes.

Default value:

None

resource

const char*

No

Explanation:

Bucket or object related to the error.

Restrictions:

None

Value range:

None

Default value:

None

further_details

const char*

No

Explanation:

The value of the FurtherDetails element in the XML error response body.

Restrictions:

None

Value range:

None

Default value:

None

extra_details_count

int

No

Explanation:

The number of other elements in the XML error response body.

Restrictions:

None

Value range:

None

Default value:

None

extra_details

obs_name_value*

No

Explanation:

Values of other elements in the XML error response body.

Restrictions:

None

Value range:

None

Default value:

None

error_headers_count

int

No

Explanation:

Number of headers in error_headers.

Restrictions:

None

Value range:

None

Default value:

None

error_headers

char**

No

Explanation:

All response headers that contain the error.

Restrictions:

None

Value range:

None

Default value:

None

Table 6 obs_name_value

Parameter

Type

Mandatory (Yes/No)

Description

name

char *

No

Explanation:

Key of a property.

Restrictions:

None

Value range:

None

Default value:

None

value

char *

No

Explanation:

Property value.

Restrictions:

None

Value range:

None

Default value:

None

Table 7 obs_status

Constant

Original Value

Description

OBS_STATUS_OK

0

The request is successful.

OBS_STATUS_InitCurlFailed

1

Failed to initialize curl.

OBS_STATUS_InternalError

2

Internal error.

OBS_STATUS_OutOfMemory

3

The local memory is insufficient.

OBS_STATUS_FailedToIInitializeRequest

6

Failed to initialize the request.

OBS_STATUS_XmlParseFailure

23

Failed to parse the XML file.

OBS_STATUS_NameLookupError

33

Domain name resolution failed.

OBS_STATUS_FailedToConnect

34

Failed to connect to the server.

OBS_STATUS_ConnectionFailed

36

Network connection failed.

OBS_STATUS_PartialFile

38

Network transmission interrupted.

OBS_STATUS_InvalidParameter

39

Invalid parameter.

OBS_STATUS_NoToken

40

The current number of concurrent tasks exceeds the upper limit (1,000 by default). The token here refers to the concurrent request token, not the security authentication token. You can use the set_online_request_max_count function to adjust the maximum number of concurrent tasks.

OBS_STATUS_OpenFileFailed

41

Failed to open the file.

OBS_STATUS_AccessDenied

43

The request is rejected.

OBS_STATUS_MalformedPolicy

44

The format of the request policy is incorrect.

OBS_STATUS_MalformedXML

45

The XML request format is incorrect.

OBS_STATUS_MethodNotAllowed

46

The request method is not allowed.

OBS_STATUS_SignatureDoesNotMatch

47

The signatures do not match. Check whether the AK, SK, and token are correct.

OBS_STATUS_ServiceUnavailable

48

Server exception.

OBS_STATUS_SlowDown

49

The request frequency is too high.