1var bodyFormData = new FormData();
2
3bodyFormData.append('userName', 'Fred');
4bodyFormData.append('image', imageFile);
5
6axios({
7 method: "post",
8 url: "myurl",
9 data: bodyFormData,
10 headers: { "Content-Type": "multipart/form-data" },
11})
12 .then(function (response) {
13 //handle success
14 console.log(response);
15 })
16 .catch(function (response) {
17 //handle error
18 console.log(response);
19 });