Http does not allow 2 Content-Type in the same request. Therefore you need to choose:
- application / x-www-form-urlencoded
- multi-part / form data
You use application/x-www-form-urlencodedusing annotations @FormUrlEncodedto send an image, you need to convert the entire file to text (e.g. base64).
A better approach would be to use multipart/form-data, describing your request as follows:
@Multipart
@POST("/datingapp/index.php/Webservice")
Call<Result> signupUser(@Part("user_name") String name,
@Part("age") String age,
@Part("work") String work,
@Part("home_town") String home_town,
@Part("gender") String gender,
@Part("interest") String interest,
@Part("study") String study,
@Part("email") String email,
@Part("password") String password,
@Part("device_id") String device_id,
@Part("device_type") String device_type,
@Part("user_image") RequestBody file,
@Part("signup") String signup);