FoxoChat.js Packages
    Preparing search index...

    Class REST

    The HTTP REST API client for foxochat.js

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    • Parameters

      • options: {
            authPrefix?: string;
            baseURL: string;
            enforceAuth?: boolean;
            request?: (
                url: RequestInfo | URL,
                init: RequestInit,
            ) => Promise<ResponseLike>;
        }
        • OptionalauthPrefix?: string

          The authorization prefix to use for requests.

        • baseURL: string

          The base API url.

        • OptionalenforceAuth?: boolean

          Enforces authorization token requirement in auth required endpoints.

        • Optionalrequest?: (url: RequestInfo | URL, init: RequestInit) => Promise<ResponseLike>

      Returns REST

    Properties

    options: RESTOptions

    Configuration options for this instance.

    Accessors

    token: any

    A token that should be used for requests.

    Methods

    • Sends a DELETE request to the API.

      Type Parameters

      • R

      Parameters

      Returns Promise<R>

    • Sends a GET request to the API.

      Type Parameters

      • R

      Parameters

      Returns Promise<R>

    • Sends a PATCH request to the API.

      Type Parameters

      • R

      Parameters

      Returns Promise<R>

    post

    • post<R>(route: `/${string}`, options?: RequestOptions): Promise<R>

      Sends a POST request to the API.

      Type Parameters

      • R

      Parameters

      Returns Promise<R>

    • Sends a PUT request to the API.

      Type Parameters

      • R

      Parameters

      Returns Promise<R>