Skip to content
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

Support List<MultipartFile> #65

Closed
vivekanandasuggu opened this issue Jun 27, 2019 · 3 comments
Closed

Support List<MultipartFile> #65

vivekanandasuggu opened this issue Jun 27, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@vivekanandasuggu
Copy link

vivekanandasuggu commented Jun 27, 2019

@Post(path:url) 
@multipart 
Future<Response> postFileAndData(
         @Query("type") int type,
         @Query("title") 
         String title, 
         @Query("email") String email , 
         @Query("owner") String owner, 
         @Query("isFileMandatory") bool isFileMandatory,
         @Part("formdata") var jsondata, 
         @PartFile("file") List<PartFile> file);


List<http.MultipartFile> list = new List();
if (_paths != null) {
  var multipat = await http.MultipartFile.fromPath(
      "file", _paths.values.toList()[0].toString());
  list.add(multipat);
}
var apiService = PostApiService.create();
final response = await apiService.postFileAndData(
    2,
    title,
    "mail@student.edu.au",
    "he-sso@edu.au",
    false,
    dataPostJson,
    null);

// i want to pass the list in the place of null

@lejard-h lejard-h changed the title I want to upload the list of multipart files using the flutter chopper library but it is not accepting the List<MultipartFile> as a parameter if any conversion needed please suggest me Support List<MultipartFile> Jul 1, 2019
@lejard-h lejard-h added the enhancement New feature or request label Jul 1, 2019
@lejard-h
Copy link
Owner

available on the last version 2.4.2

@vivekanandasuggu
Copy link
Author

Thank you, you are just awesome lejard..can we please give support for the application/x-www-form-urlencoded with the annotation @FormUrlEncoded

@vivekanandasuggu
Copy link
Author

In the chopper changelog for 2.4.1 you have written "Deprecate @fieldfield, use @partfile instead",
that @fieldfield should be changed to @FileField..Please update these latest enhacements sample request code in the readme or in the example, so that it would be more eye caching for the users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants