You can use the @MultiPart Post with @PartMap as parameter
Map<String, TypedFile> files = new HashMap<String, TypedFile>();
files.put("my file number one", new TypedFile("image/jpg", new File(filename)));
files.put("my file number two", new TypedFile("image/jpg", new File(filename)));
apiInterface.updateProfileWithImage("first name here", files);
private interface ApiInterface{
@Multipart
@POST("/users/updateProfile/")
Response updateProfileWithImage(
@Part("user_id") TypedString first_name,
@PartMap Map<String,TypedFile> Files
);
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…