Preparing search index...

    Response object from RemoteServiceModule API requests.

        // 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.');
    Index

    Constructors

    Properties

    body: Buffer

    Buffer containing the response body data.

    linkedResources: LinkedResource[]

    Array of resources linked to the response.

    statusCode: number

    HTTP status code of the response.