0

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. enter image description here

I tried this using JSON.stringify() to serialize.But it's not working. anyone can help me with this..?

What I expect to like this: enter image description here

Zenixo
  • 727
  • 1
  • 12
  • 36

0 Answers0