TypedRest for TypeScript - v0.4.0
    Preparing search index...

    Interface HttpClient

    HTTP client used to communicate with remote resources.

    interface HttpClient {
        defaultHeaders: Headers;
        send(
            uri: URL,
            method: HttpMethod,
            signal?: AbortSignal,
            headers?: HeadersInit,
            body?: BodyInit,
        ): Promise<Response>;
    }

    Implemented by

    Index

    Properties

    Methods

    Properties

    defaultHeaders: Headers

    Default HTTP headers to set for requests when not explicitly overridden.

    Methods

    • Sends an HTTP request.

      Parameters

      • uri: URL

        The URI to send the message to.

      • method: HttpMethod

        The HTTP method to use.

      • Optionalsignal: AbortSignal

        Used to cancel the request.

      • Optionalheaders: HeadersInit

        The HTTP headers to set.

      • Optionalbody: BodyInit

        The body to send.

      Returns Promise<Response>