TylerT
Windmill2y ago
Tyler

Accepting raw body

I have webhooks submitting data that is not structured well.
Is it possible to just accept the entire POST body as a single variable?

Something like:
export async function main(hook: string) {}


Example input:
event=lead_added
data[source]=widget
data[lead][last_name]=N/A


When I run it, it says the input arguments are this, but I can't define these as the parameter names in the function, it's invalid javascript.

export async function main(
    'data[lead][last_name]': string,
    'data[source]': string,
    event: string,
) {
Was this page helpful?