@aracna/core - v1.5.0
    Preparing search index...

    Class RestAPI<T, U>

    The RestAPI class manages the requests to a REST API.

    • The base URL of the API is automatically concatenated to the path of the requests.
    • The config of the API is automatically merged with the config of the requests.
    • The status of the requests is automatically tracked and can be accessed through the status property.
    • The requests are sent with the Fetch class, so all features of the Fetch class are available.

    Aracna Reference

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    baseURL: string

    The base URL of the REST API.

    config: T

    The default config of the REST API.

    status: Status

    The status of the requests.

    Methods

    • Handles the pending state of the request.

      Type Parameters

      • V

      Parameters

      Returns Promise<boolean>

    post

    • Transforms the body of the request.

      Type Parameters

      • V

      Parameters

      Returns Promise<any>

    • Transforms the query parameters of the request.

      Type Parameters

      • V

      Parameters

      Returns Promise<string>