Generic calls and specialized calls
Alibaba Cloud SDKs support generic calls and specialized calls. Learn the differences between the two call methods in terms of package size, development experience, and applicable scenarios to select the method that best suits your needs.
Generic calls
Generic calls (CommonRequest) use only the Client class and common parameter configuration class from the core SDK to call OpenAPI operations.
Advantages
-
Reduces the code package size after integration. You need to depend only on the core SDK, even when you use multiple products.
-
Allows you to call API operations that are published but not yet listed in the Alibaba Cloud Help Center or OpenAPI Explorer.
Disadvantages
Code hinting is unavailable, so you must consult the documentation during development.
Specialized calls
Specialized calls use the Client, Request, and Response classes from a product-specific SDK to call OpenAPI operations.
Advantages
The Client class handles special OpenAPI request logic and common product parameters, reducing the number of parameters you need to specify. The Request and Response classes encapsulate OpenAPI parameters, enabling code hinting for passing parameters and retrieving return values.
Disadvantages
-
Unavailable for products that do not have a corresponding Alibaba Cloud SDK.
-
Requires a separate SDK for each product, which increases the code package size.
The V1.0 Node.js/TypeScript SDK supports only generic calls, not specialized calls.
Usage guide
|
Language |
V2.0 SDK |
V1.0 SDK |
||
|
Specialized call |
Generalized call |
Specialized call |
Generalized call |
|
|
Java |
||||
|
Python |
||||
|
Node.js |
/ |
|||
|
Go |
||||
|
PHP |
||||
|
.NET |
||||