auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps, params) => {
}
const config = {
method: event.method || "POST",
url: params.url,
}
const { query } = event
if (Object.keys(query).length) {
config.params = query
}
// Headers, removing the original Host
const { headers } = event
delete headers.host
if (Object.keys(headers).length) {
config.headers = headers
}
if (steps.trigger.raw_event.body_b64) config.data = Buffer.from(steps.trigger.raw_event.body_b64, 'base64')
return await require("@pipedreamhq/platform").axios(this, config)