tencent cloud

Performance Testing Service

Related Agreements
Service Level Agreement
Use Limits
Privacy Policy
Data Processing And Security Agreement
문서Performance Testing Service

CloudAPISignatureV3Param

포커스 모드
폰트 크기
마지막 업데이트 시간: 2025-03-10 17:23:47
CloudAPISignatureV3Param is the parameter object used when calling the util.cloudAPISignatureV3 method for signing.

Field

Field
Type
Description
secretID
string
Secret ID, used to identify the API caller.
secretKey
string
Secret Key, used to authenticate the API caller.
service
string
Product name.
method
string
Call method, such as "POST".
timestamp
string
Timestamp
body
string, object, or ArrayBuffer.
Request body.
query
Record<string, string>
Request parameters.
headers
Record<string, string>
Request header.

Samples

Call the util.cloudAPISignatureV3 method for signing:
import util from 'pts/util';
import http from 'pts/http';

export default function () {
const timestamp = parseInt(new Date().getTime() / 1000);
const body = {
EnvironmentId: 'wtp',
TopicName: 'access_server',
ClusterId: 'pulsar-vgb3w9ezndvx',
};
const headers = {
'Content-Type': 'application/json',
Host: 'tdmq.tencentcloudapi.com',
'X-TC-Action': 'DescribeSubscriptions',
'X-TC-Version': '2020-02-17',
'X-TC-Timestamp': timestamp.toString(),
'X-TC-Region': 'ap-guangzhou',
};
// Call util.cloudAPISignatureV3, the internal parameter is CloudAPISignatureV3Param
headers.Authorization = util.cloudAPISignatureV3({
secretID: 'xxx',
secretKey: 'xxx',
service: 'tdmq',
method: 'POST',
timestamp,
headers,
body,
});
const resp = http.post('https://tdmq.tencentcloudapi.com', body, {
headers,
});
console.log(resp.body);
}


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백