You need to enable JavaScript to run this app.
Torch Log Service

Torch Log Service

Copy page
Download PDF
Previous versions of the iOS SDK
Retrieve iOS SDK responses (legacy)
Copy page
Download PDF
Retrieve iOS SDK responses (legacy)
The TLS iOS SDK provides a unified response wrapper for each implemented interface. This document describes how to obtain various response information from the SDK.​
Retrieve request response fields​
You can use response.fieldName to obtain the return fields of each API described in CreateProject. Code example:​
​
......​
DescribeProjectsResponse *response = [client DescribeProjects:request];​
NSLog(@"HttpStatusCode: %@", response.fieldName);​
......​
​
Retrieve the HTTP status code​
You can use response.statusCode to obtain the response code for the request. Code example:​
​
......​
DescribeProjectsResponse *response = [client DescribeProjects:request];​
NSLog(@"HttpStatusCode: %@", response.statusCode);​
......​
​
Retrieve error information​
If the response code is not 200, you can use response.errorCode and response.errorMessage to obtain the error code and error description, which can help you troubleshoot issues. Code example:​
​
......​
DescribeProjectsResponse *response = [client DescribeProjects:request];​
NSLog(@"ErrorCode: %@, ErrorMessage: %@", response.errorCode, response.errorMessage);​
......​
​
Retrieve the request RequestId​
To obtain assistance from TLS support when encountering difficulties during TLS API calls, you can use response.requestId to record the requestId of the Exception request and provide it to TLS staff for faster issue response and resolution. Code example:​
​
......​
DescribeProjectsResponse *response = [client DescribeProjects:request];​
NSLog(@"RequestId: %@", response.requestId);​
......​
​
Serialize the request response as a JSON string​
You can also directly serialize the response using the toJSONString method to visually inspect the request response. Code example:​
​
......​
DescribeProjectsResponse *response = [client DescribeProjects:request];​
NSLog(@"Response json string: %@", [response toJSONString]);​
......​
​
​
Last updated: 2026.10.28 14:22:45