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.
Go to Header and select Content-Type = application/json then go to body and select raw and then pass an array. Save this answer. Show activity on this post.
Arrays can have more than one dimension. For example, the following declaration creates a two-dimensional array of four rows and two columns. int[,] array = new int[4, 2]; The following declaration creates an array of three dimensions, 4, 2, and 3.
To pass an array as an argument to a method, you just have to pass the name of the array without square brackets. The method prototype should match to accept the argument of the array type. Given below is the method prototype: void method_name (int [] array);
Just send it in raw format(in json) and specify data type as application/json. Worked for me
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With