Belin.io Core
    Preparing search index...

    Class Client

    Performs HTTP requests.

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Creates a new HTTP client.

      Parameters

      • baseUrl: string | URL = document.baseURI

        The base URL of the remote service.

      Returns Client

    Properties

    baseUrl: URL

    The base URL of the remote service.

    Methods

    • Performs a DELETE request.

      Parameters

      • Optionalurl: string | URL

        The URL of the resource to fetch.

      • Optionaloptions: RequestInit

        The request options.

      Returns Promise<Response>

      The server response.

    • Performs a GET request.

      Parameters

      • Optionalurl: string | URL

        The URL of the resource to fetch.

      • Optionaloptions: RequestInit

        The request options.

      Returns Promise<Response>

      The server response.

    • Performs a PATCH request.

      Parameters

      • Optionalurl: string | URL

        The URL of the resource to fetch.

      • Optionalbody: unknown

        The request body.

      • Optionaloptions: RequestInit

        The request options.

      Returns Promise<Response>

      The server response.

    post

    • post(
          url?: string | URL,
          body?: unknown,
          options?: RequestInit,
      ): Promise<Response>

      Performs a POST request.

      Parameters

      • Optionalurl: string | URL

        The URL of the resource to fetch.

      • Optionalbody: unknown

        The request body.

      • Optionaloptions: RequestInit

        The request options.

      Returns Promise<Response>

      The server response.

    • Performs a PUT request.

      Parameters

      • Optionalurl: string | URL

        The URL of the resource to fetch.

      • Optionalbody: unknown

        The request body.

      • Optionaloptions: RequestInit

        The request options.

      Returns Promise<Response>

      The server response.