@pathmaker-digital/pmd-utilities - v2.2.6
    Preparing search index...

    Function proFetchPost

    • A "pro" implementation of generic fetch/post.

      Parameters

      • host: string

        Host address to push to.

      • endpoint: string

        Endpoint to target.

      • body: Record<string, any>

        The record to post.

      • log: boolean = false

        Whether to log responses or not. Defaults to false.

      Returns Promise<any>

      const response = await proFetchPost(
      "https://api.example.com",
      "submit",
      { name: "Alice", score: 42 },
      true
      );
      console.log(response); // Logs the confirmation or resulting data from the POST request.