Horje
Axios FormData / not JSON Code Example
axios post formdata
axios({
    method: 'post',
    url: 'myurl',
    data: bodyFormData,
    headers: {'Content-Type': 'multipart/form-data' }
    })
    .then(function (response) {
        //handle success
        console.log(response);
    })
    .catch(function (response) {
        //handle error
        console.log(response);
    });
Axios FormData / not JSON
var bodyFormData = new FormData();
bodyFormData.append('userName', 'Fred');

If you are uploading images, you may want to use .append
bodyFormData.append('image', imageFile); 

axios({
  method: "post",
  url: "myurl",
  data: bodyFormData,
  headers: { "Content-Type": "multipart/form-data" },
})
  .then(function (response) {
    //handle success
    console.log(response);
  })
  .catch(function (response) {
    //handle error
    console.log(response);
  });




Javascript

Related
bootstrap 4 navbar-collapse not working angular Code Example bootstrap 4 navbar-collapse not working angular Code Example
jquery ajax responseText Code Example jquery ajax responseText Code Example
how to access dictionary keys in js Code Example how to access dictionary keys in js Code Example
get last element in an array jqury Code Example get last element in an array jqury Code Example
shadow using react native Code Example shadow using react native Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7