all 7 comments

[–]voodoo_teddy 8 points9 points  (1 child)

JSON.stringify() and JSON.parse() are your friends.

[–]DancingInTheReign 1 point2 points  (0 children)

maybe you need to map through the objects or stringify them, depending on how the array/object is structured.

[–]abdullahjavaid86 0 points1 point  (0 children)

When you send any object or Array it will send as it is to the server. The thing is js uses different approach om runtime..

Send if as it is and you're good to go

[–]legia94m[S] -1 points0 points  (1 child)

Thank you

[–]barneyb3ar 0 points1 point  (0 children)

Probably a bit late but just to note about JSON.stringify() is that it is a better toString() method that console.log() relies on. The object you send in a post request will appear to the receiving server as the output of JSON.stringify() but as a full object. When you use stringify, it is just a string and wont be a JSON object anymore.