Function defaultPawnoteFetcher

  • Simple and default fetcher using fetch if none was given in the authentication function.

    Parameters

    • url: string
    • options: {
          body?: string | FormData;
          headers?: Record<string, string> | Headers;
          method: "GET" | "POST";
          redirect?: "follow" | "manual";
      }
      • Optional body?: string | FormData

        Body of the request of type given in the "Content-Type" header.

      • Optional headers?: Record<string, string> | Headers

        Headers that should be appended to the request.

      • method: "GET" | "POST"
      • Optional redirect?: "follow" | "manual"

        Whether we should automatically handle the redirections or do it by hand.

    Returns Promise<{
        headers: Record<string, string> | Headers;
        json: (<T>() => Promise<T>);
        text: (() => Promise<string>);
    }>