let formData = new FormData(formElement);
fetch("/pushworker", {
body: {
uri: formData.uri,
type: formData.type,
name: formData.name,
},
headers: {
"Content-Type": "multipart/form-data",
},
method: "POST",
}).then((data) => console.log(data));
Type '{ uri: any; type: any; name: any; }' is not assignable to type 'BodyInit | null | undefined'.
const formData = new FormData(formElement);
const fetchArgs = {
method: "POST",
body: formData,
};
fetch("/pushworker", fetchArgs).then((data) => console.log(data));
const formData = new FormData();
const uri = formElement.querySelector("[name=uri]").value;
formData.append("uri", uri);