I've been using Postman Chrome extension to test out my API and would like to send an array of IDs via post. Is there a way to send something list this as a parameter in Postman?
{
user_ids: ["1234", "5678"]
}
I've been using Postman Chrome extension to test out my API and would like to send an array of IDs via post. Is there a way to send something list this as a parameter in Postman?
{
user_ids: ["1234", "5678"]
}
I tried all solution here and in other posts, but nothing helped.
The only answer helped me:
Adding [FromBody] attribute before decleration of parameter in function signature:
This also works for lists within the object:
the equivalent JSON would be:
In form-data,
Go to Header and select![enter image description here](https://i.stack.imgur.com/tTAT3.png)
Content-Type
=application/json
then go to body and selectraw
and then pass an array.For me did not work with array[0], array1, .. or array[], array[], ... . It works more simply:![enter image description here](https://i.stack.imgur.com/oOnKu.jpg)
Choose either form-data or urlencoded and use the same key "user_ids". The server should receive it as an array.