title: how to do a GET request using retrofit2?
body: <p>I have a restfull web service which is running on a localhost. I would like to make a retrofit2 GET request on that rest URL. </p>
  
  <p><strong>MainActivity.java</strong>    </p>
  
  <pre><code>private void requestData() {
          public static final String BASE_URL = "http://192.168.0.103:8080/SpringWithHibernate/users/";
          Toast.makeText(MainActivity.this, "In requestData() :: " + "ddd", Toast.LENGTH_LONG).show();
  
          Gson gson = new GsonBuilder().create();
  
          Retrofit retrofit = new Retrofit.Builder()
                  .baseUrl(BASE_URL)
                  .addConverterFactory(GsonConverterFactory.create(gson))
                  .build();
  
          GetUserListAPI api = retrofit.create(GetUserListAPI.class);
  
          api.getUsersList().enqueue(new Callback&lt;List&lt;UserPojo&gt;&gt;() {
              @Override
              public void onResponse(Call&lt;List&lt;UserPojo&gt;&gt; call, Response&lt;List&lt;UserPojo&gt;&gt; response) {
                  Log.d("UserList :: ", "Success");
                  Log.d("UserList :: ", "Code :: " + response.code());
  
                  user = response.body();
  
  //                Log.d("UserList :: ", "count :: " + user.size());
  
  //                Log.d("UserList :: ", "Result :: " + user.get(1).getUsername());
              }
  
              @Override
              public void onFailure(Call&lt;List&lt;UserPojo&gt;&gt; call, Throwable t) {
                  Log.d("UserList :: ", "Failure");
              }
          });
  
      }
  </code></pre>
  
  <p><strong>GetUserListAPI.java</strong> interface:</p>
  
  <pre><code>public interface GetUserListAPI {
      @GET("/users")
      Call&lt;List&lt;UserPojo&gt;&gt; getUsersList();
  }
  </code></pre>
  
  <p>When I make a call to requestData() method I keep getting response.code() as 404.</p>
  
  <p>Can anyone help me where should I have mistaken?</p>
  
  <p>Thanks &amp; Regards.</p>