[Vuejs]-How to send array and formdata with axios – Vue

3👍

In form data, you can’t send array directly.

In order to send array in formdata you have to run a loop and pass values like this:

const array = [1,2,3,4,5,6];

const formData = new FormData();

array.forEach(function(value) {
  formData.append("id[]", value) // you have to add array symbol after the key name
})
👤Rahul

Leave a comment