chopper icon indicating copy to clipboard operation
chopper copied to clipboard

send array is not the same behavior as retrofit

Open humazed opened this issue 6 years ago • 6 comments

when sending @Field("preferences[]") List<int> preferences

chopper sends: { "preferences[]":[2000008,2000149] }

retrofit sends: { "preferences[]":2000008, "preferences[]":2000149 }

in my app, I depend on this default behavior

take a look at: https://stackoverflow.com/questions/53832007/how-to-send-liststring-with-retrofit

humazed avatar Jun 23 '19 19:06 humazed

From what I see on Retrofit, it is not possible on FormUrl (and probable json) encoded data and I don't see a way to do it with http package in dart since body is based on HashMap.

But it should be possible for Multipart request

lejard-h avatar Jul 01 '19 20:07 lejard-h

Yes, you are right, I was thinking in chopper @Field works with Multipart.

humazed avatar Jul 01 '19 23:07 humazed

Stale issue message

github-actions[bot] avatar Sep 26 '19 00:09 github-actions[bot]

Related to following PR in http package https://github.com/dart-lang/http/pull/278

lejard-h avatar Sep 29 '19 11:09 lejard-h

What should we do with this issue?

The referenced PR in http is pretty much neglected since Jun 18, 2019... :/

stewemetal avatar Jan 15 '21 22:01 stewemetal

Indeed, maybe we should start investigate on how to do it on chopper side

lejard-h avatar Jan 17 '21 10:01 lejard-h

Fixed in https://github.com/lejard-h/chopper/pull/439

techouse avatar Sep 03 '23 20:09 techouse