Library API
    Preparing search index...

    Function fetchRequest

    • Performs an HTTP fetch request with built-in timeout, JSON parsing, and custom prefix handling. Automatically throws an HttpError if the response is not ok.

      Type Parameters

      • T

      Parameters

      • url: string | URL

        The resource URL to fetch

      • init: RequestInit = ...

        Optional RequestInit configuration

      • config: Config = ...

        Optional configuration including timeout and prefix stripping

      Returns Promise<T>

      A promise resolving to the parsed response body

      const data = await fetchRequest`<MyData>`('https://api.example.com');