Support methods related to network communication.

Methods

  • Build the options for fetch.

    Parameters

    • method: UFFetchMethod

      Method to use

    • url: string

      Url to call

    • OptionalbodyData: null | object | FormData

      Optional body data; if it is a FormData instance it just get set, else the data is sent as JSON.

    • OptionalupdateHeadersCallback: (headers: Headers) => any

      Optional callback to add additional headers.

    Returns RequestInit

    options for use with fetch

  • Closes the group.

    Parameters

    • path: string

      Path to API call

    Returns void

  • Sends an IO error to the console and closes the group.

    Parameters

    • error: Error

      Exception error

    • method: UFFetchMethod

      Method used

    • path: string

      Path to API call

    Returns void

  • Send the IO result to the console and closes the group.

    Parameters

    • response: Response
    • method: UFFetchMethod

      Method used

    • path: string

      Path to API call

    • receivedBody: null | string | object = null

      Body data received

    Returns void