skip to Main Content
'patient_age': patientAge!,
    'test_date': testdate!,
    "test_id[]": testIDs[0].toString(),

The api i got takes "test_id[]" repeatedly for list of test ids in body and in postman the api testing is working fine.
But when I try this test_id[] in body it shows map doesn’t accept same key. How can I send a list in this pattern?
See The pattern in postman - screenshot

2

Answers


  1. You should try:

    "test_id":testIDs
    
    • key is test_id
    • value is testIDs (data type is List)
    Login or Signup to reply.
  2. This is not supported in HttpClient from the http package (c.f. https://github.com/dart-lang/http/issues/47).

    However, it seems that it’s possible using the dio package: https://pub.dev/documentation/dio/latest/dio/ListFormat.html

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search