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"]
}
You can pass like this. Hope this will help someone.
You need to suffix your variable name with
[]
like this:If that doesn't work, try not putting indexes in brackets:
Note:
If you are using the postman packaged app, you can send an array by selecting
raw
/json
(instead ofform-data
). Also, make sure to setContent-Type
asapplication/json
inHeaders
tab. Here is example for raw data{"user_ids": ["123" "233"]}
, don't forget the quotes!If you are using the postman REST client you have to use the method I described above because passing data as raw (json) won't work. There is a bug in the postman REST client (At least I get the bug when I use
0.8.4.6
).I also had that problem, and solved it by doing the following:
1 - Going to the request header configuration and added the following:
2 - To send the json array, I wen to raw json format and set the array:
in headers set
In body select option
and insert data as json array
As mentioned by @pinouchon you can pass it with the help of array index
Example:
If you want an array of dicts, try this: