Skip to main content

getExecHttpPost

Creates an HTTP POST strategy executor that handles wallet service communication via HTTP POST requests. This function manages the full lifecycle including polling for responses, handling local views, and managing user interactions.

Import

You can import the entire package and access the function:


_10
import * as fcl from "@onflow/fcl-core"
_10
_10
fcl.getExecHttpPost(execLocal)

Or import directly the specific function:


_10
import { getExecHttpPost } from "@onflow/fcl-core"
_10
_10
getExecHttpPost(execLocal)

Usage


_10
// Create an HTTP POST executor
_10
const httpPostExec = getExecHttpPost(async (view, { serviceEndpoint, onClose }) => {
_10
// Render local view and return cleanup function
_10
return [viewData, () => cleanup()]
_10
})

Parameters

execLocal

  • Type:

_10
export type ExecLocalFunction = (
_10
view: any,
_10
options: {
_10
serviceEndpoint: typeof serviceEndpoint
_10
onClose: () => void
_10
}
_10
) => Promise<[any, () => void]>

  • Description: Function to execute local view rendering and user interaction

Returns


_10
({ service, body, config, opts }: ExecHttpPostParams) => Promise<any>

HTTP POST strategy function that can be used to execute services


Rate this page