Theia API Documentation v1.76.0
    Preparing search index...

    Request of a typed route handler, see ExternalApiRouter.

    interface RestRequest<B = undefined> {
        authorized: boolean;
        body: B;
        params: Readonly<Record<string, string>>;
        raw: Request;
    }

    Type Parameters

    • B = undefined
    Index

    Properties

    authorized: boolean

    Whether the request carries the configured external API token; true when no token is configured. For routes of token-protected contributions this is always true, as unauthorized requests are rejected before the handler runs. Unprotected contributions can use it to serve a reduced public view to unauthorized requests, as the OpenAPI document endpoint does.

    body: B

    The schema-valid request body; undefined for routes without a body schema.

    params: Readonly<Record<string, string>>

    Path parameters of the matched route, e.g. id for a route registered on /:id.

    raw: Request

    The underlying express request, e.g. to access the query string or headers.