LensStudio:RemoteServiceModule.RemoteApiResponse
ClassResponse object from RemoteServiceModule API requests.
Index
Properties
Example
// RemoteApiResponse is received in the callback of performApiRequest().
// It has a protected constructor — you never instantiate it directly.
//
// Properties (all readonly):
// body: Editor.Buffer — response body data
// linkedResources: RemoteApiResponse.LinkedResource[] — linked resource URLs
// statusCode: number — HTTP status code
const { RemoteApiRequest, performApiRequest } = await import('LensStudio:RemoteServiceModule');
const request = RemoteApiRequest.create();
request.endpoint = '/v1/test';
request.specId = 'test-spec';
request.parameters = {};
performApiRequest(request, (response) => {
// body: Editor.Buffer containing the response payload
console.log('statusCode:', response.statusCode);
console.log('body byte length:', response.body.toBytes().length);
// linkedResources: array of LinkedResource objects
console.log('linkedResources count:', response.linkedResources.length);
for (const resource of response.linkedResources) {
console.log('linked resource url:', resource.url);
}
});
console.log('RemoteApiResponse is received via performApiRequest callback.');
console.log('Properties: body (Buffer), linkedResources (LinkedResource[]), statusCode (number) — all readonly.');
Properties
body
readonlybody:Buffer
Buffer containing the response body data.
linkedResources
readonlylinkedResources:LinkedResource[]
Array of resources linked to the response.
statusCode
readonlystatusCode:number
HTTP status code of the response.
Nested types
Classes
| Class | Description |
|---|---|
| LinkedResource | Represents a resource linked to the API response. |