I am trying to append an array of objects through form data. But it's not working as I expected. This is my Array ob object.
const children = [{title:"MacBook",type:"LapTop"},{title:"MSI",type:"LapTop"}]
This is how I append my data to formData.
const formData = new FormData();
children.forEach(item => {
formData.append('children[]', item)
});
But this is how the final output.
I tried this using JSON.stringify()
to serialize.But it's not working. anyone can help me with this..?