-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 fix Multipart for List<int> and List<String> #439
🐛 fix Multipart for List<int> and List<String> #439
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #439 +/- ##
===========================================
+ Coverage 93.75% 93.80% +0.05%
===========================================
Files 8 8
Lines 448 452 +4
===========================================
+ Hits 420 424 +4
Misses 28 28
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@JEuler I'd like to get your thoughts on this one, as the solution is quite opinionated, however, I see no other way of making it work. Quite frankly, I'm surprised it wasn't addressed earlier. 😅 |
I've read your discussion on the issue and looked at the PR. As I understand, nothing can be done better, because Chopper utilizes the http package. So, we can, of course, provide something like an option to offer the capability to join list of ints to one array... but I don't feel like we should because it is easy to do by using "stringification". So, LGTM. |
Well yes, in the case of |
# chopper ## 6.1.4 - [FIX] #439
Adds the ability to do something like
which will produce this payload (cURL form just for brevity)
The gist of this is to use bracket notation (
field[0]
,field[1]
,field[2]
, ...) to overcome the limitation ofMultipartRequest.fields
which is aMap<String, String>
and as such can not have repeated keys.This limitation has been discussed before in dart-lang/http#277 and dart-lang/http#24.
The solution I've implemented is exactly the same as suggested here dart-lang/http#277 (comment)
Addresses #77, #316 and #438