Level 58
Here's an example of how to use the fetch API in Vue 3 to upload files:
const formData = new FormData();
formData.append('file', file);
fetch('My url here', {
method: 'POST',
body: formData,
})
.then(response => {
// Handle response
})
.catch(error => {
// Handle error
});
Note that fetch does not require the contentType and processData options like $.ajax does. Also, make sure to replace file with the actual file you want to upload.