My problem is that I send a record of type FormData to my netlify function.
Form code:
const onSubmitWithReCAPTCHA = async (e) => {
e.preventDefault()
const action = e.target.action
const data = new FormData(e.target)
const token = await recaptchaRef.current.executeAsync()
data.set("g-recaptcha-response", token)
fetch(action, {
method: "post",
body: data,
}).then((_response) => {
return navigate("/")
})}
That is my WebKitFormBoundary which arrives in the netlify function:
------WebKitFormBoundaryi7nDDId3RXxrRRso
Content-Disposition: form-data; name="bot-field"
------WebKitFormBoundaryi7nDDId3RXxrRRso
Content-Disposition: form-data; name="form-name"
newsletter
------WebKitFormBoundaryi7nDDId3RXxrRRso
Content-Disposition: form-data; name="email"
test@gmail.com
------WebKitFormBoundaryi7nDDId3RXxrRRso
Content-Disposition: form-data; name="g-recaptcha-response"
------WebKitFormBoundaryi7nDDId3RXxrRRso--
How can I resolve this WebKitFormBoundary in the netlify function to extract the email as a string?
Unfortunately I have not found an example on the Internet…