How to send array of object using postman as a formdata
Asked Answered
A

5

9

I am trying to send an array of the object as a form-data using postman. But it's not working. I follow this link in StackOverflow...But it's worked for mt.

enter image description here

When I send my category like this it's sent like this:- Category returns null property. enter image description here

This should be like this. I got this screenshot when I was passing data application/JSON. enter image description here

But now I need to send an image with my req, I need to send my req as a form/data. But My Category object array is not passing the way I want, Or the way my system wants. I really need your help. Thank you.

Applecart answered 10/2, 2022 at 8:54 Comment(2)
Have you found the answer to this?Cytolysin
@Arvind suresh Update my answere.Applecart
A
12

Found Solutions by myself. You can send the request like this.

enter image description here.

Applecart answered 5/4, 2022 at 15:57 Comment(2)
what should be the content type and how to handle this array in nodejs?Goggle
This solution will not work with nested arrayShih
R
3

You can easily send an array or array of objects as form-data in postman, using this approach.

  1. Add normal key-value pair as shown, make sure the array is in it's raw format. A key value pair of an array

  2. On the server use this method to receive the array. enter image description here

This should work!!

Regatta answered 7/6, 2023 at 19:37 Comment(1)
Please do not post images of code.Smithers
A
2

list of json objects

I'll leave this here might help someone , since all didn't work for me except this one .

prizes[0]name => iPhone 14 pro
prizes[0]count => 5
prizes[1]name => iPhone 15
prizes[1]count => 3
prizes[2]name => iPhone 15 Pro Max
prizes[2]count => 1

the structure will be like

prizes = [
{
"name": "iPhone 14 pro",
"count": 5
},
{
"name": "iPhone 15",
"count": 3
},
{
"name": "iPhone 15 Pro Max",
"count": 1
}
]
Amplexicaul answered 11/10, 2023 at 10:9 Comment(1)
Please do not add images of code or data. Instead edit your post and write directly into the post.Thermobarometer
L
0

Without the array index also work enter image description here

Limoges answered 11/11, 2022 at 21:24 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.