Request Structure Overview
Last updated: 2020-02-26 15:17:18
You can call a Tencent Cloud API by sending a request that include specified request parameters to an API endpoint.. The request structure of Tencent Cloud API consists of service address, communication Protocol, request method, request parameters and character coding. See below for details
The service access address of TencentCloud API depends on the specific module. For more information, see the description of each API.
Most TencentCloud APIs communicate via HTTPS, providing highly secure communications tunnels.
Tencent Cloud APIs support both POST and GET requests.
- POST and GET requests cannot be mixed. If GET is used, the parameters are obtained from Querystring; if POST is used, the parameters are obtained from Request Body, while the parameters in Querystring are ignored. The request parameters are organized in the same way in both types of requests. Generally, the GET method is used. If the parameter strings are too long, the POST method is used.
- If the user's request method is GET, all the request parameter values need to be encoded by URL. If it is POST, there is no need to encode the parameters.
- The maximum length of GET requests varies according to different browser and server settings. For example, traditional IE browsers are limited to 2K and Firefox is limited to 8K. For some API requests with more parameters and longer length, it is recommended that you use the POST method to avoid failure of the request due to the string exceeding the maximum length during the request process.
- For POST requests, you need to use the
x-www-form-urlencodedBecause the cloud API side is from $ _ That fetches the request parameters in the POST.
Two types of parameters are required for each Tencent Cloud API request: common request parameters and API request parameters. The common request parameters are the request parameters that are used by each interface. For more information, please see Common Request Parameters The interface request parameters are unique to each interface, as described in the "request parameters" description of each interface.
All requests for Tencent Cloud APIs and their returned results are encoded using the UTF-8 character set.