You can call this operation to set a custom origin request header for a CDN domain.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes SetReqHeaderConfig

The operation that you want to perform. Set the value to SetReqHeaderConfig.

DomainName String Yes www.macaron.org.cn

The name of the CDN domain to set the custom origin request header for.

Key String Yes testkey

The name of the custom origin request header.

Value String Yes testvalue

The value of the custom origin request header.

ConfigId Long No 123

The ID of the configuration to be modified.

Response parameters

Parameter Type Example Description
RequestId String 04F0F334-1335-436C-A1D7-6C044FE73368

The ID of the request.

Examples

Sample requests

http(s)://cdn.aliyuncs.com? Action=SetReqHeaderConfig
&DomainName=www.macaron.org.cn
&Key=testkey
&Value=testvalue
&<Common request parameters>

Sample success responses

XML format

<SetReqHeaderConfigResponse>
	  <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
</SetReqHeaderConfigResponse>

JSON format

{
	"RequestId":"04F0F334-1335-436C-A1D7-6C044FE73368"
}

Error codes

HTTP status code Error code Error message Description
400 MissingParameter The specified value of parameter DomainName can not be empty. The error message returned because the DomainName parameter is not specified.
400 MissingParameter The specified value of parameter Key can not be empty. The error message returned because the Key parameter is not specified.
400 MissingParameter The specified value of parameter Value can not be empty. The error message returned because the Value parameter is not specified.
400 InvalidKey.Malformed The specified value of parameter Key is not malformed. The error message returned because the specified Key parameter is invalid.
400 InvalidValue.Malformed The specified value of parameter Value is not malformed. The error message returned because the specified Value parameter is invalid.
400 InvalidHeaderKey.ValueNotSupported The specified value of parameter HeaderKey is not supported. The error message returned because the specified Key parameter is not supported. Valid values of the Key parameter: Content-Type, Cache-Control, Content-Disposition, Content-Language, Expires, Access-Control-Allow-Origin, Access-Control-Allow-Methods, Access-Control-Allow-Headers, Access-Control-Max-Age, Access-Control-Expose-Headers, and Access-Control-Allow-Credentials.

For more information about error codes, visit API Error Center.