TuyaSmartRequest Class Reference

Inherits from NSObject
Declared in TuyaSmartRequest.h

Other Methods

– requestWithApiName:postData:version:success:failure:

Network request for Tuya server API. 调用服务端API

- (void)requestWithApiName:(NSString *)apiName postData:(nullable NSDictionary *)postData version:(NSString *)version success:(nullable TYSuccessID)success failure:(nullable TYFailureError)failure

Parameters

apiName

API name

postData

API params

version

API version

success

Success block

failure

Failure block

Discussion

Network request for Tuya server API. 调用服务端API

Declared In

TuyaSmartRequest.h

– requestWithApiName:postData:getData:version:success:failure:

Network request for Tuya server API. 调用服务端API

- (void)requestWithApiName:(NSString *)apiName postData:(nullable NSDictionary *)postData getData:(nullable NSDictionary *)getData version:(NSString *)version success:(nullable TYSuccessID)success failure:(nullable TYFailureError)failure

Parameters

apiName

API name

postData

API params

getData

Common params

version

API version

success

Success block

failure

Failure block

Discussion

Network request for Tuya server API. 调用服务端API

Declared In

TuyaSmartRequest.h

– cancel

Cancel network request

- (void)cancel

Discussion

Cancel network request

Declared In

TuyaSmartRequest.h

+ removeAllCache

Remove network cache

+ (void)removeAllCache

Discussion

Remove network cache

Declared In

TuyaSmartRequest.h

ApiMerge Methods

– addMergeRequestWithApiName:postData:version:success:failure:

Invoke multiple api in one network request. 一次网络请求调用多个API

- (void)addMergeRequestWithApiName:(NSString *)apiName postData:(nullable NSDictionary *)postData version:(NSString *)version success:(nullable TYSuccessID)success failure:(nullable TYFailureError)failure

Parameters

apiName

API name

postData

API params

version

API version

success

Success block

failure

Failure block

Discussion

Invoke multiple api in one network request. 一次网络请求调用多个API

Declared In

TuyaSmartRequest.h

– sendMergeRequestWithSuccess:failure:

Send multiple api request. 发送合并API请求

- (void)sendMergeRequestWithSuccess:(nullable TYSuccessList)success failure:(nullable TYFailureError)failure

Parameters

success

Success block

failure

Failure block

Discussion

Send multiple api request. 发送合并API请求

Declared In

TuyaSmartRequest.h

– sendMergeRequestWithGetData:success:failure:

Send multiple api request. 发送合并API请求

- (void)sendMergeRequestWithGetData:(nullable NSDictionary *)getData success:(nullable TYSuccessList)success failure:(nullable TYFailureError)failure

Parameters

getData

Common params

success

Success block

failure

Failure block

Discussion

Send multiple api request. 发送合并API请求

Declared In

TuyaSmartRequest.h

– removeAllMergeRequest

Remove all multiple api request. 清空合并API请求

- (void)removeAllMergeRequest

Discussion

Remove all multiple api request. 清空合并API请求

Declared In

TuyaSmartRequest.h

Encryption Methods

– requestPostDataEncryptWithApiName:postData:version:success:failure:

Network request for Tuya server API with post data encrypt. 调用服务端API

- (void)requestPostDataEncryptWithApiName:(NSString *)apiName postData:(nullable NSDictionary *)postData version:(NSString *)version success:(nullable TYSuccessID)success failure:(nullable TYFailureError)failure

Parameters

apiName

API name

postData

API params

version

API version

success

Success block

failure

Failure block

Discussion

Network request for Tuya server API with post data encrypt. 调用服务端API

Declared In

TuyaSmartRequest.h