Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I send 2 dimension array as parameter in POSTMAN?

Tags:

arrays

postman

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.

like image 811
Vyacheslav Avatar asked Jul 30 '14 08:07

Vyacheslav


People also ask

How do you pass an array parameter in Postman?

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.

Can we declare arrays with more than one dimension?

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.

How do you send data to an array?

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);


1 Answers

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

like image 195
deb2fast Avatar answered Sep 19 '22 03:09

deb2fast