retrofit.dart icon indicating copy to clipboard operation
retrofit.dart copied to clipboard

how do we send PartMap as in Android lib? Or how can I set dynamic name for each file in the list of files?

Open romawizard opened this issue 1 year ago • 1 comments

Use case: I have to send FormData with the "data" fields and a list of files. Each file should have its own name (in my case the structure is the following: "image[0]", "image[1]" and so on).

It would be nice to have a function parameter in the @Part annotation that provides a way to generate a parameter name based on the index in the array.

The second option is to create a new annotation @PartMap that could be applied to Map<String, File>

romawizard avatar Sep 28 '23 18:09 romawizard

@trevorwang Thanks for taking a look

romawizard avatar Oct 20 '23 10:10 romawizard