Interface to potentially override the default fetch API.

interface NetworkService {
    fetchRequest(
        url: string,
        body: string,
        headers?: Headers,
        method?: "POST" | "GET",
    ): Promise<Response>;
}

Methods

Methods

  • Single method to execute fetch requests, identical of the fetch API.

    Parameters

    • url: string

      URL

    • body: string

      body

    • Optionalheaders: Headers

      headers

    • Optionalmethod: "POST" | "GET"

      "POST" | "GET"

    Returns Promise<Response>