I'm using flutter retrofit package and I need to implement a request as shown in attached postman screenshot
this is what I do, but it didn't work
@override
@POST('/update/document')
@MultiPart()
Stream<double> uploadDocument(@Part() int id, @Part() File document);
the problem was that the file "document" not added to parameters list
CodePudding user response:
Add name
parameter inside your @Part
annotation.
@override
@POST('/update/document')
@MultiPart()
Stream<double> uploadDocument(@Part(name:"id") int id,
@Part(name:"document") File document);