title: onResponse won't execute when calling data with retrofit
body: <p>I try to call data with Retrofit, but I got problem that my method inside <code>callBack ()</code> won't execute, (onResponse executed but onFailure executed) what is wrong with my code? Thanks in advance.</p>
  
  <p>Here is when I am calling with retrofit:</p>
  
  <pre><code> private void checkSubscription() {
      Call&lt;APIResponse&lt;List&lt;DataStatusSubscribe&gt;&gt;&gt; call = ServicesFactory.getService(this).getStatusSubscribe(own.msisdn);
      call.enqueue(new Callback&lt;APIResponse&lt;List&lt;DataStatusSubscribe&gt;&gt;&gt;() {
  
          // ======== This method won't execute ===========
          **@Override
          public void onResponse(Call&lt;APIResponse&lt;List&lt;DataStatusSubscribe&gt;&gt;&gt; call, Response&lt;APIResponse&lt;List&lt;DataStatusSubscribe&gt;&gt;&gt; response) {
              if (response.isSuccessful() &amp;&amp; response.body().isSuccessful()){
                  List&lt;DataStatusSubscribe&gt; dataStatusSubscribes = response.body().data;
                  String status = dataStatusSubscribes.get(dataStatusSubscribes.size()-1).getStatus();
                  if (status.equals("0")){
                      showPopupSubscribe();
                  }
              }**
  
  
          }
        // ======== This method won't execute ===========
          @Override
          public void onFailure(Call&lt;APIResponse&lt;List&lt;DataStatusSubscribe&gt;&gt;&gt; call, Throwable t) {
  
          }
      });
  
  }
  </code></pre>
  
  <p>Here is my JSON data structure :</p>
  
  <pre><code>    {
      "code": 200,
      "error_message": null,
      "data": [
          {
              "ID": "6917",
              "msisdn": "2013304044",
              "operator_id": "3",
              "service": "AB3",
              "status": "0",
              "apps_status": "0",
              "sub_start": "2018-04-10 16:48:28",
              "sub_end": "2018-04-10 16:59:50",
              "renewal": "0000-00-00"
          }
      ]
  }
  </code></pre>
  
  <p>Here is my APIResponse :</p>
  
  <pre><code>public class APIResponse&lt;T&gt; extends BaseResponse {
      public T data;
  }
  </code></pre>
  
  <p>Here is my BaseResponse :</p>
  
  <pre><code>public abstract class BaseResponse {
      @SerializedName("code")
      public String code;
  
  
  public boolean isSuccessful(){
      if(code.equalsIgnoreCase("200")){
          return true;
      }
      return false;
    }
  }
  </code></pre>
  
  <p>This is ServiceFactory.java :</p>
  
  <pre><code>public class ServicesFactory {
  private static boolean ENABLE_LOGGING = BuildConfig.DEBUG;
  private static String BASE_URL = "http://abc/def/";
  
  public static Services getService(Context context) {
      Retrofit retrofit = new Retrofit.Builder()
              .baseUrl(BASE_URL)
              .client(generateClient(context))
              .addConverterFactory(GsonConverterFactory.create())
              .build();
      return retrofit.create(Services.class);
  }
  
  private static OkHttpClient generateClient(Context context) {
      OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder()
              .connectTimeout(60, TimeUnit.SECONDS)
              .readTimeout(60, TimeUnit.SECONDS)
              .writeTimeout(60, TimeUnit.SECONDS);
  
      if (ENABLE_LOGGING) {
          HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
          loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
          clientBuilder.addInterceptor(loggingInterceptor);
      }
      return clientBuilder.build();
  }
  }
  </code></pre>
  
  <p>Here is my interface :</p>
  
  <pre><code>@FormUrlEncoded
  @POST("checkSubscribe")
  Call&lt;APIResponse&lt;List&lt;DataStatusSubscribe&gt;&gt;&gt; getStatusSubscribe(@Field("msisdn") String msisdn);
  </code></pre>