0

I cannot find an suitable way to test API with the request parameter whose data type is List https://blog.csdn.net/a907691592/article/details/107051586

For my POST API, the request parameters are List<String> s and List<Double> d I have tried Postman (1)~(3), but all failed

(1) Body

key value
s 123
s 456
d 1.234
d 5.678

(2) Params

key value
s 123,456
d 1.234,5.678

(3) Params + Pre-request Script

key value
s {{sstr}}
d {{dstr}}

pm.collectionVariable.set("sstr", JSON.stringify(["123","456"]);
pm.collectionVariable.set("dstr", JSON.stringify([Number(1.234), Number(5.678)];
Ricky
  • 1
  • 1

0 Answers0