Hi,
So I’m trying to send form submissions from my Nuxtjs app but it always results in an error stating that all my fields are empty. I send my data using a DataForm object, when I console.log() my data all my inputs are filled, I have no idea why it doesn’t send them.
Looking at posts here I found this one REST API Authentication on client-side requests which is exactly the same problem I encounter, sadly it never got any real answer.
Just like this person, I also have errors stating that the authentification failed in system logs.
Here are my console.logs and response from gravity form ( “ce champ est nécessaire” means “this field is required”) as we can see, all my fields are filled
async function sendEmail(formData) {
sending.value = true;
const url = appStore.baseJson+'/gf/v2/forms/'+id+'/submissions'
await $fetch(url , {
method : 'POST',
headers: {
"Authorization": 'Basic '+ btoa(username+':'+password), // tried without this line aswell, same error
"Content-Type": "multipart/form-data"
},
body : formData
}).then( (response) => {
console.log(response)
sending.value = false;
sent.value = true;
}).catch( (error) => {
console.log(error)
sending.value = false;
});
}