output-sdk
    Preparing search index...

    Function sendHttpRequest

    • Send an HTTP request to a URL.

      For POST or PUT requests, an optional payload can be sent as the body.

      The "Content-Type" is inferred from the payload type and can be overridden via the headers argument.

      If the body is not a type natively accepted by the Fetch API, it is serialized to a string: JSON.stringify() for objects, or String() for primitives.

      Parameters

      • params: {
            headers?: Record<string, string>;
            method?: HttpMethod;
            payload?: object;
            url: string;
        }

        Parameters object

        • Optionalheaders?: Record<string, string>

          Headers for the request

        • Optionalmethod?: HttpMethod

          The HTTP method (default: 'GET')

        • Optionalpayload?: object

          Request payload (only for POST/PUT)

        • url: string

          Request URL

      Returns Promise<SerializedFetchResponse>

      Resolves with an HTTP response serialized to a plain object

      • Intended for use within workflow functions; do not use in steps or evaluators.
      • Steps and evaluators are activity-based and can perform HTTP requests directly.
      • If used within steps or evaluators, a compilation error will be raised.
      • Uses a Temporal Activity to dispatch the HTTP request, working around the runtime limitation for workflows.