When submitting a form via the fetch method (React/Gatsby). The submissions are going through successfully but it seems that the data isn’t exactly matching up with the body.
I’m getting this strange data when I view submissions:
Netlify instance: https://practical-thompson-134dc2.netlify.com/
My submit handler is:
fetch("/", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
body: encode({ "form-name": "contact", ...values }),
})
.then(() => alert("Success!"))
.catch(error => alert(error))
and the encoded body is:
{contactName: "jonathan", phone: "0411111111", email: "qwdqwd@gmail.com", message: ""}
Is there something I’m missing? Why is HTML being passed through?