Available APIs
fetch
A browser-compatible fetch function is available.
Example
async ({ payload, event }) => {
const res = await fetch("https://postman-echo.com/post", {
method: "POST",
headers: {
"content-type": "application/json"
},
body: JSON.stringify(payload)
})
const jsonResponse = await res.json()
return { jsonResponse }
}
Documentation
https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API (opens in a new tab)