First, you are trying to send mediaType "application / json" as @Multpart if you want to send a multi-part file, so you need to change something in your code.
Something like that:
@Multipart @POST("/profile/update") Call<RegistrationResponse> updateProfile2( @Header(value = "X-AUTH-TOKEN") String toke, @Part("myfile\"; filename=\"image.png\" ") RequestBody file);
And change the calling method to this:
RequestBody file = RequestBody.create(MediaType.parse("multipart/form-data"), myFile); return apiService.updateProfile2(token, file);
source share