直接上示例,下图的oldFileNames就是集合,只要传多个value对应一个集合key就可以了。

以下示例供参考:
因为不同的postman版本好像输入方法不同,所以挨着试试看下面的方法。
如果要输入一个arrayList,arr={111,222};
方法1 把list元素分个写
参数名 参数值
arr[0] 111
arr[1] 222
If that doesn't work, try not putting indexes in brackets:
-
my_array[] value1 -
my_array[] value2
Note:
-
If you are using the postman packaged app, you can send an array by selecting
raw/json(instead ofform-data). -
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). -
Just in case someone is asking how to add hashes instead of just array, the idea is still the same, just change the indexes to hash name
my_array[hashname] value1 -
my_array[] 123, 345, 456 works fine -
my_array[] valuewill create a array parameter with the values provided, askey => [value].my_array[key] valuewill create a hash, as{key => value}.
方法2
Here is my solution:
use form-data and edit as below:
-
Key Value -
box[] a -
box[n1] b -
box[n2][] c -
box[n2][] d
and you will get an array like this:
{"box":{"0":"a","n1":"b","n2":["c","d"]}}
方法3

本文介绍如何使用Postman发送数组与哈希数据。提供了三种方法:一是将数组元素作为独立参数发送;二是使用form-data方式发送复杂结构;三是通过原始JSON格式发送。这些方法适用于不同版本的Postman客户端。
2万+

被折叠的 条评论
为什么被折叠?



