UMD Web Utilities Library
    Preparing search index...

    Function fetchREST

    • Sends a JSON GET request to a REST endpoint

      Shared entry point for REST reads, so request settings common to every call can change in one place. Callers handle the status and body.

      Parameters

      • url: { url: string }

        The endpoint URL

      Returns Promise<Response>

      Promise resolving to the fetch Response

      const response = await fetchREST({
      url: 'https://gateway.designsystem.umd.edu/v1/feeds/campus-alerts',
      });

      if (response.ok) {
      const data = await response.json();
      }