This topic describes the common request headers that are used in the API requests of KMS Instance API. This topic also provides an example of an API request.

Parameters

KMS Instance API uses the HTTP protocol and is in the Protocol Buffers format. The following table describes common request headers that can be used in all API requests.
HeaderTypeRequiredDescription
AcceptStringNoThe type of data that the client wants the server to return. Only application/x-protobuf is supported.
AuthorizationStringYesThe content of the signature. The signature is in the following format: TOKEN {Signature}.

For more information, see Request signatures.

Content-LengthNumeric valueNoThe length of the HTTP request body that is defined in RFC 2616. This header is not required for requests that do not contain a request body.
Content-SHA256StringNoThe hex string in uppercase that is generated after the request body is calculated by using SHA-256. This header is not required for requests that do not contain a request body.
Content-TypeStringNoThe type of the HTTP request body that is defined in RFC 2616. Only application/x-protobuf is supported. This header is not required for requests that do not contain a request body. The value varies based on API definitions.
DateStringYesThe time when the request is sent. Only the RFC 1123 message format is supported. The time is in Coordinated Universal Time (UTC). The string is in the following format: Mon, 3 Jan 2010 08:33:47 UTC.
x-kms-apiversionStringYesThe version number of the API. The current version is dkms-gcs-0.2.
x-kms-apinameStringYesThe name of the API operation that you call. Valid values:
x-kms-signaturemethodStringYesThe signature algorithm. Only RSA_PKCS1_SHA_256 is supported.
x-kms-acccesskeyidStringYesThe ID of the access key. Only the client key that is bound to the application access point (AAP) is supported.

Example

POST / HTTP/1.1
Accept: application/x-protobuf
user-agent: AlibabaCloud (Linux; amd64) Java/1.8.0_302-b08 tea-util/0.2.6 TeaDSL/1
Authorization: TOKEN <Signature>
Content-Length: 40
content-sha256: AE71057543002AD513AB88D78509A1214192C09F20302C4BF8F59B7EB565****
Content-Type: application/x-protobuf
Date: Mon, 27 Sep 2021 11:47:26 GMT
x-kms-apiversion: dkms-gcs-0.2
x-kms-apiname: Encrypt
x-kms-signaturemethod: RSA_PKCS1_SHA_256
x-kms-acccesskeyid: KAAP.9c84ad54-a55d-75bd-235d-7c26d509****
host: kst-****.cryptoservice.kms.aliyuncs.com