Question:
I dont have that much of coding experience, could anyone check my code?
I want to send form data to a webhook, but the form contains a file upload field and need that PDF to be sent as well
I want to send form data to a webhook, but the form contains a file upload field and need that PDF to be sent as well.
I am trying to use Fetch function with Post method.
import {fetch} from ‘wix-fetch’;
// …
fetch( " https://hook.eu1.make.com/d5dylma39sisp324pzg2bbeazbxdi2gt", {
“method”: “post”,
“headers”: {
“Content-Type”: “application/x-www-form-urlencoded”
},
“body”: “somekey=somevalue”
} )
.then( (httpResponse) => {
if (httpResponse.ok) {
return httpResponse.json();
} else {
return Promise.reject(“Fetch did not succeed”);
}
} )
.then( (json) => console.log(json.someKey) )
.catch(err => console.log(err));
I want to know if this one will work for my needs?