'patient_age': patientAge!,
'test_date': testdate!,
"test_id[]": testIDs[0].toString(),
我得到的 API 反复使用
test_id[]
来获取正文中的测试 ID 列表,并且在邮递员中,API 测试工作正常。
但是当我在正文中尝试这个test_id[]
时,它显示地图不接受相同的密钥。我如何以这种模式发送列表?
你应该尝试:
"test_id":testIDs
http
包中的 HttpClient 不支持此功能(参见 https://github.com/dart-lang/http/issues/47)。
但是,似乎可以使用
dio
包:https://pub.dev/documentation/dio/latest/dio/ListFormat.html