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. |
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 CloudAPISignatureV3Paramheaders.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);}
Feedback