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.

2
  • Have you found the answer to this? Commented Apr 5, 2022 at 5:57
  • @Arvind suresh Update my answere. Commented Apr 5, 2022 at 15:58

5 Answers 5

14

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

enter image description here.

Sign up to request clarification or add additional context in comments.

2 Comments

what should be the content type and how to handle this array in nodejs?
This solution will not work with nested array
4

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!!

2 Comments

Please do not post images of code.
This does not work
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
}
]

1 Comment

Please do not add images of code or data. Instead edit your post and write directly into the post.
2

You can index with brackets and access a property with dot notation:

Comments

0

Without the array index also work enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.