cloudAPISignatureV3(param: CloudAPISignatureV3Param): string
Parameter | Type | Description |
param | Name parameters. |
Type | Description |
string | Signature results. |
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 the method.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);}