RAW
// RAW
const response = await fetch("https://MYAPI_ENDPOINT/LEADS", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
});
// x-www-form-urlencoded
const formBody = new URLSearchParams();
for (const key in payload) {
formBody.append(key, payload[key]);
}
const response = await fetch("https://MYAPI_ENDPOINT/LEADS", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
body: formBody.toString(),
});