Member Junction
    Preparing search index...
    • Performs a single HTTP request using native fetch. This is the primitive the rest of the module is built on — the method shorthands and HttpClient all funnel through it.

      Reach for a shorthand (HttpGet, HttpPost, …) for one-off calls, and for HttpClient when several requests share a base URL, credentials, or retry policy.

      Type Parameters

      • T = unknown

        the expected shape of the parsed response body.

      Parameters

      Returns Promise<HttpResponse<T>>

      the HttpResponse, whose Data is parsed per ResponseType.

      on a non-2xx status (unless ThrowOnError is disabled), on a timeout, on caller cancellation, or on a transport failure. Inspect Status / IsTimeout / IsCancelled to tell them apart.

      when ValidateUrl is enabled and the URL — or any redirect hop — resolves to a private or reserved address. This propagates as itself rather than being wrapped in an HttpError, so a security decision is never mistaken for an unreachable host.

      const response = await HttpRequest<{ items: Item[] }>({
      Url: 'https://api.example.com/items',
      Query: { page: 1 },
      });
      return response.Data.items;
      const response = await HttpRequest({ Url: url, ThrowOnError: false });
      if (response.Status === 404) return null;