{"status":"0","message":"Login unsuccessful :( This account doesn't exist or the email is not verified yet! try asking admin for activation and then logging in ;)"}
Here Is My Url
http://zeenatkhanniazai.com/services/login.php
Login class and Interface
public static String BASE_URL="http://zeenatkhanniazai.com/services/"; public static loginServices loginn=null; public static loginServices Login(){ if (loginn == null ){ Retrofit retrofit=new Retrofit.Builder().baseUrl(BASE_URL) .addConverterFactory(GsonConverterFactory.create()) .build(); loginn = retrofit.create(loginServices.class); } return loginn; } public interface loginServices{ @POST("login.php/{uemail}/{upassword}") retrofit2.Call<User> login(@Path("uemail") String uemail, @Path("upassword") String upassword); } MainActivity
String femail=email.getText().toString(); String fpasssword=password.getText().toString(); Call<User> call=LoginApi.Login().login(femail,fpasssword); call.enqueue(new Callback<User>() { @Override public void onResponse(Call<User> call, Response<User> response) { User users= response.body(); users.getMessege(); Toast.makeText(MainActivity.this, "respoces"+new Gson().toJson(response.body()), Toast.LENGTH_SHORT).show(); } @Override public void onFailure(Call<User> call, Throwable t) { Toast.makeText(MainActivity.this, "f", Toast.LENGTH_SHORT).show(); } And Here Is My User Class
@SerializedName("message") private String message; @SerializedName("status") private String status; public String getStatus() { return status; } public String message() { return message; }
messagein@SerializedNameinstead ofmessegehttp://zeenatkhanniazai.com/services/login.php/youremail/yourpassword; is it correct ?@Fieldinstead of@path. also try@POST("login.php")