This topic describes the differences between CommonRequest and SDKs to help you decide which one you should use to call API operations in specific scenarios.
CommonRequest is a minimal SDK that performs only core tasks for API calls, such as signature processing. CommonRequest does not encapsulate the metadata of specific APIs.
An SDK encapsulates the metadata of a specific API.
Contained in CommonRequest. You do not need to calculate signature values.
Contained in SDKs. You do not need to calculate signature values.
You must decide which request method to use by referring to the API reference. You can make an API request by using a method such as POST or GET and specifying the attributes of a request object.
Contained in SDKs. You do not need to specify request methods.
You must specify common parameters such as the service, API version, response body format, and the action name or URI of the API operation that you want to call. You can obtain the values of common parameters from the API reference.
Contained in SDKs. You do not need to specify common parameters for API calls.
You must specify and serialize business-related parameters in the format that is specified in the API reference. Much effort must be spent on serialization and debugging.
An SDK provides a structured request object that encapsulates business-related parameters. You can specify business-related parameters as prompted in an integrated development environment (IDE). The SDK serializes the business-related parameters that you specify. This ensures that the parameters are serialized in the correct format.
A raw string is returned. You must parse and serialize the string into a structured object by referring to the API reference.
An SDK parses the response of an API call and generates a structured response object that consists of the response parameters specified in the API reference. You can find the response parameters that you need as prompted in an IDE.
Supported by all Alibaba Cloud services.
SDKs of the earlier version are supported only by some Alibaba Cloud services, whereas SDKs of the latest version are supported by all Alibaba Cloud services.
OpenAPI Explorer provides CommonRequest samples for services that do not support SDKs of the earlier version.
OpenAPI Explorer provides samples for both SDKs of the earlier version and SDKs of the latest version. OpenAPI Explorer also provides SDK samples for more than 50 services in specific scenarios.
The advantage of CommonRequest lies in the compact size of its package. You need to deploy only one CommonRequest package to call API operations of all services. However, CommonRequest has disadvantages in user experience. If you use CommonRequest, you must check the API reference all the way and face the lack of auto-complete suggestions in an IDE.
Compared with CommonRequest, SDKs bring more convenience to development processes. When you use SDKs in an IDE, the IDE can provide a variety of suggestions such as parameter names, methods, and data types. The only problem is that SDKs are service-specific. Some services may not provide SDKs. If your application uses multiple Alibaba Cloud services, you must install multiple SDK packages. This makes the size of your application package comparatively larger.
To ensure good development experience, we recommend that you use SDKs in most cases. We recommend that you use CommonRequest only if no SDK is available for a specific service or you want to ensure that your application code is small in size.