postman 如何在post请求中使用http参数“test_id[]”来发布列表?

2ledvvac  于 8个月前  发布在  Postman
关注(0)|答案(2)|浏览(94)
'patient_age': patientAge!,
    'test_date': testdate!,
    "test_id[]": testIDs[0].toString(),

我得到的API在body和postman中重复使用test_id[]作为测试ID列表,API测试工作正常。但是当我在body中尝试这个test_id[]时,它显示map不接受相同的键。如何发送此模式的列表?

u2nhd7ah

u2nhd7ah1#

你应该尝试:

"test_id":testIDs
  • key是test_id
  • 值为testIDs(数据类型为List)
t5zmwmid

t5zmwmid2#

这在http包的HttpClient中不受支持(参见https://github.com/dart-lang/http/issues/47)。
但是,似乎可以使用dio包:https://pub.dev/documentation/dio/latest/dio/ListFormat.html

相关问题