Astrada TypeScript SDK
    Preparing search index...

    Class BaseAPI

    This is the base class for all generated API classes.

    Hierarchy (View Summary)

    Index
    configuration: Configuration
    middleware: Middleware[]

    The middleware of this instance; protected so hand-written subclasses can pass it on.

    • Check if the given MIME is a JSON MIME. JSON MIME examples: application/json application/json; charset=UTF8 APPLICATION/JSON application/vnd.company+json

      Parameters

      • mime: string

        MIME (Multipurpose Internet Mail Extensions)

      Returns boolean

      True if the given MIME is JSON, false otherwise.

    • Sends the request. Network errors and timeouts (while waiting for the answer or reading its body), 408, 429 and 5xx are retried for idempotent methods (see ConfigurationParameters.maxRetries). A 401 is retried once with a new token. Any other status outside 200 to 299 throws a ResponseError subclass. The body is read here, whole.

      Parameters

      Returns Promise<Response>

    • Type Parameters

      Parameters

      • this: T
      • ...postMiddlewares: ((context: ResponseContext) => Promise<void | Response>)[]

      Returns T