Created
February 19, 2022 12:51
-
-
Save marifuli/a9e30b9b3342da9d9c7eff799bcbe2ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let data = new FormData(); | |
data.append('file', file, file.name); | |
axios.post( | |
URL, | |
data, | |
{ | |
headers: { | |
'accept': 'application/json', | |
'Accept-Language': 'en-US,en;q=0.8', | |
'Content-Type': `multipart/form-data; boundary=${data._boundary}`, | |
} | |
} | |
) | |
.then((response) => { | |
//handle success | |
}) | |
.catch((error) => { | |
//handle error | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment