I try to make a multipart request with retrofit 2.0 to upload an image to my server.
For now I have RequestBody with my image
RequestBody requestFile = RequestBody.create(MediaType.parse("image/*"), file);
Then I create from data in this way
imagenPerfil = MultipartBody.Part.createFormData("user[image]",file.getName(),requestFile);
My retrofit interface
@Multipart
@Headers({"Accept: application/json","X-OS:android","X-Api-Version:1","X-FIREBASE-TOKEN:token"})
@POST("/update_user_details")
Call<UserDetailAddResponse> uploadMulFile(@Header("X-User-Token") String token_header, @Header("X-User-Email") String email,
@PartMap Map<String,Map<String,Object>> object,
@Part MultipartBody.Part image);
request taking too much time to go on server or in the end it stop or don't send request on server..what i have to do would i use this in another Thread or is it okay ?