In my application i want upload image from phone to server with Retrofit2 .
For this job i find some sources from internet, but in one source use this :
public interface RetrofitInterface {
@Multipart
@POST("/images/upload")
Call<Response> uploadImage(@Part MultipartBody.Part image);
}
and in other source this below :
public interface ApiConfig {
@Multipart
@POST("images/upload_image.php")
Call<ServerResponse> upload(
@PartMap Map<String, RequestBody> map);
}
In first source use @Part MultipartBody.Part image and in second source use @PartMap Map<String, RequestBody> map .
What's the difference between the two?
Which one do I use better?