Fetch API & Handling JSON Responses
What advantage does FormData provide when used with fetch?
const formData = new FormData(form);
const response = await fetch('/api/upload', {
method: 'POST',
body: formData
});
if (response.ok) {
const result = await response.json();
console.log(result);
}