Function fetchApi

Makes an asynchronous HTTP request using the Fetch API.

  • If an error occurs during the request.
  • Type Parameters

    • T = any

    Parameters

    • input: URL | RequestInfo

      The resource URL or an instance of the URL class.

    • Optionalinit: RequestInit

      The request options.

    Returns Promise<T>

    • The response data as a Promise.