Request Structure Overview
Last updated: 2019-09-23 11:46:43
You can call a TencentCloud API by sending a request to the API server address that contains the request parameters specified in the API description. The structure of a TencentCloud API request consists of service address, communication protocol, request method, request parameters and character encoding, as detailed below:
The service access address of TencentCloud API depends on the specific module. For more information, see the descriptions of each API.
Most of TencentCloud APIs communicate via HTTPS, providing highly secure communication tunnels.
TencentCloud API supports both POST and GET requests.
- POST and GET requests cannot be used together. If GET is used, parameters are taken from the query string. If POST is used, parameters are taken from request body, and parameters in the query string are ignored. The parameter format rules of the two request methods are identical. GET requests are generally used. If the parameter string is too long, POST is recommended.
- If the GET method is used, all request parameters need to be URL-encoded. This is not required if the POST method is used.
- The maximum length of GET requests varies by browser and server settings. For example, the limit is 2 KB in IE and 8 KB in Firefox. For long API requests with a lot of parameters, we recommend using the POST method to avoid request failure due to overlong string.
- For POST requests, the input parameters should be in the form of
x-www-form-urlencoded, because TencentCloud API acquires the request parameters from $_POST.
Two types of parameters are required for each TencentCloud API request: common request parameters and API request parameters. Common request parameters are required for every API (see Common Request Parameters, while API request parameters are specific to each API (see "Request Parameters" in each API document).
Both the request and returned result of TencentCloud API are encoded using the UTF-8 character set.