Send different types of data with the Fetch API

// Sending Form Data
const formData = new FormData();
formData.append('key', 'value');

// Sending Images
const image = new Blob([imageFile], {type: 'image/jpeg'});

fetch('https://...', {
  method: 'POST',
  body: formData
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));