title: Simple retrofit2 request to a localhost server
body: <p>trying to make an android app that will communicate with a localhost server (tomcat apache) which use noSQL server (app->tomcat->noSQL). I already manage to make a servlet that handle params on "get" method and load them correctly to the database, now I am trying to insert the data from my app using retrofit2 lib.
  following vids and tutorials I still couldnt manage to make this work.</p>
  
  <p>this is the interface I am using:</p>
  
  <pre><code>public interface APIService {
  
      @POST("login")
      Call&lt;Boolean&gt; postUser(@Body User user);
  
      @GET("login")
      Call&lt;Boolean&gt; getUser(@Query("user_email") String user_email,@Query("user_pass") String user_pass);
  
      public static final Retrofit retrofit = new Retrofit.Builder()
              .baseUrl("http://localhost:8080/")
              .addConverterFactory(GsonConverterFactory.create())
              .build();
  }
  </code></pre>
  
  <p>and this is the code I am using when the button is clicked in the app:</p>
  
  <pre><code>APIService ApiService = APIService.retrofit.create(APIService.class);
  
  User user = new User(name, email);
  Call&lt;Boolean&gt; call = ApiService.getUser(email,name);
  call.enqueue(new Callback&lt;Boolean&gt;() {
      @Override
      public void onResponse(Call&lt;Boolean&gt; call, Response&lt;Boolean&gt; response) {
          String ans = response.message(); //for debugging
          if (ans.compareTo("yes") == 0) {
              Toast.makeText(getApplicationContext(), "YES!", Toast.LENGTH_SHORT).show();
          } else if (ans.compareTo("no") == 0) {
              Toast.makeText(getApplicationContext(), "NO!", Toast.LENGTH_SHORT).show();
          } else {
              Toast.makeText(getApplicationContext(), "ELSE?!", Toast.LENGTH_SHORT).show();
          }
      }
  
      @Override
      public void onFailure(Call&lt;Boolean&gt; call, Throwable t) {
          Toast.makeText(getApplicationContext(), t.getMessage(), Toast.LENGTH_SHORT).show();
      }
  
  
  
  });
  </code></pre>
  
  <p>so atm, nothing happen when I am clicking the button.(it used to crush but it stopped) and I am sure the the button's function is being called.</p>