9

I need to send parameters as array of objects in POSTMAN.

"array": [
    {"field1": "html", "field2": "5"},
    {"field1": "css", "field2": "3"}
 ]

I know that array must send as array[] but how can I set one item of the array as an object?

I tried this

"array[]" : "{"field1": "html", "field2": "5"}" 

But I'm getting a 500 response error.

Xan
  • 71,217
  • 14
  • 165
  • 189
Vyacheslav
  • 552
  • 1
  • 8
  • 16
  • possible duplicate of [Postman chrome extension with array of hashes as value](http://stackoverflow.com/questions/24239042/postman-chrome-extension-with-array-of-hashes-as-value) – Xan Jul 30 '14 at 11:04
  • @Xan Thank you for respond. I've tried to use: array[0][field1] html array[0][field2] 5 But got error 500 – Vyacheslav Jul 30 '14 at 13:52
  • I think it will help for u
    https://stackoverflow.com/questions/12756688/is-it-possible-to-send-an-array-with-the-postman-chrome-extension
    – suresh Jun 02 '17 at 12:20

4 Answers4

11

enter image description hereJust send it in raw format(in json) and specify data type as application/json. Worked for me

Taimoor Changaiz
  • 9,398
  • 4
  • 47
  • 52
deb2fast
  • 992
  • 11
  • 18
  • Yep, it could be used also – Vyacheslav Nov 18 '16 at 21:31
  • 1
    The requirement is to send the data as form-data and not with raw data. The reason behind this: To support existing code. If you know how I can send this data in form-data then please let me know. – Zubin Shah Dec 03 '19 at 05:04
7

If array of arrays works for you as well, you can send them like this:

enter image description here

gradosevic
  • 4,411
  • 2
  • 32
  • 47
1

Go to bulk edit

userdata:[{"name":"name1","email":"email1@gmail.com"},{"name":"name2","email":"email2@gmail.com"},{"name":"name3","email":"email3@gmail.com"}]
0

I found the solution adding raw data as JSON. from body > raw

[
  {
    "text": "Buy fish",
    "completed": true
  },
  {
    "text": "Go for walk check",
    "completed": false
  },
  {
    "text": "Pick baby from school",
    "completed": false
  }
]
Saif
  • 1,756
  • 2
  • 18
  • 30