title: Retrofit response.body() is null, but API JSON visible in Logcat
body: <p>I have my Android Java REST API code working perfectly with another REST API that uses a JSON object hierarchy (aka List-bracket-object1-bracket object2). Now I moved on to a simplified API (googlemaps timezone - just one simple object with 5 fields) but I cannot figure out how to get the google data into my object. </p>
  
  <p>I am getting status code 200, I can see the googlemaps output/JSON in my logcat but my object is null. I read this post "0 Retrofit 2: response.body() is null, but status code is 200 2" and I am sure I have the same problem but I do not know how to adjust my object model to fix it. Here is my stuff...</p>
  
  <p>1 - API/URL I am hitting:
  <a href="https://maps.googleapis.com/maps/api/timezone/json?location=39.6034810,-119.6822510&amp;timestamp=1331161200&amp;key=xxxxxx" rel="nofollow noreferrer">https://maps.googleapis.com/maps/api/timezone/json?location=39.6034810,-119.6822510&amp;timestamp=1331161200&amp;key=xxxxxx</a></p>
  
  <p>2 - What the API/URL returns (from my LogCat)</p>
  
  <pre><code>D/OkHttp: {
  D/OkHttp:    "dstOffset" : 0,
  D/OkHttp:    "rawOffset" : -28800,
  D/OkHttp:    "status" : "OK",
  D/OkHttp:    "timeZoneId" : "America/Los_Angeles",
  D/OkHttp:    "timeZoneName" : "Pacific Standard Time"
  D/OkHttp: }
  </code></pre>
  
  <p>3 - Logcat showing object is null</p>
  
  <pre><code>Log.e(" main ", " apt " + response.body().getResults());
  E/ main:  apt null
  </code></pre>
  
  <p>4 - The calling routine</p>
  
  <pre><code>ApiInterface apiService = ApiClient.getClient(1).create(ApiInterface.class);
  Call&lt;ApiTimes&gt; call = apiService.getTime(location,epoch,GOOG_TZ_KEY);
  call.enqueue(new Callback&lt;ApiTimes&gt;() {
      @Override
      public void onResponse(Call&lt;ApiTimes&gt; call, Response&lt;ApiTimes&gt; response) {
          int statusCode = response.code();
          Log.e(" main ", " apt " + response.body().getResults());
      }
      @Override
      public void onFailure(Call&lt;ApiTimes&gt; call, Throwable t) {
          Log.e(" getFS ", t.toString());
      }
      });
  </code></pre>
  
  <p>5 - The object. </p>
  
  <pre><code>public class ApiTime {
  
      @SerializedName("apitime")
      private ApiTime apitime;
  
      @SerializedName("dstOffset")
      @Expose
      private Long dstOffset;
      @SerializedName("rawOffset")
      @Expose
      private Long rawOffset;
      @SerializedName("status")
      @Expose
      private String status;
      @SerializedName("timeZoneId")
      @Expose
      private String timeZoneId;
      @SerializedName("timeZoneName")
      @Expose
      private String timeZoneName;
  
      public ApiTime(Long dstOffset, Long rawOffset, String status, String timeZoneId, String timeZoneName) {
          this.dstOffset = dstOffset  ;
          this.rawOffset =  rawOffset ;
          this.status = status  ;
          this.timeZoneId = timeZoneId  ;
          this.timeZoneName = timeZoneName  ;
      }
  
      public ApiTime getResults() {
          return apitime;
      }
  
      public void setResults(ApiTime apitimes) {
          this.apitime = apitime;
      }
  
      public Long getDstOffset() {
          return dstOffset;
      }
      public void setDstOffset(Long dstOffset) {
          this.dstOffset = dstOffset;
      }
      public Long getRawOffset() {
          return rawOffset;
      }
      public void setRawOffset(Long rawOffset) {
          this.rawOffset = rawOffset;
      }
      public String getStatus() {
          return status;
      }
      public void setStatus(String status) {
          this.status = status;
      }
      public String getTimeZoneId() {
          return timeZoneId;
      }
      public void setTimeZoneId(String timeZoneId) {
          this.timeZoneId = timeZoneId;
      }
      public String getTimeZoneName() {
          return timeZoneName;
      }
      public void setTimeZoneName(String timeZoneName) {
          this.timeZoneName = timeZoneName;
      }
  
      @Override
      public String toString() {
          return "ApiTime{" +
                  "dstOffset=" + dstOffset +
                  ", rawOffset=" + rawOffset +
                  ", status='" + status + '\'' +
                  ", timeZoneId='" + timeZoneId + '\'' +
                  ", timeZoneName='" + timeZoneName + '\'' +
                  '}';
      }
  }
  </code></pre>
  
  <p>6 - Here are the two invocation routines:</p>
  
  <pre><code>public class ApiClient {
      public static final String URL0 = blah blah
      public static final String URL1 = "https://maps.googleapis.com/maps/api/timezone/";
      private static Retrofit retrofit = null;
      public static  String BASE_URL = "www.google.com";
      public static Retrofit getClient(int url) {
  
          BASE_URL = URL0;
          if (url == 1){
              BASE_URL = URL1;
          }
          //The following block of code generates OkHttpClient loggging to LogCat.
          //Only use if debugging.
          OkHttpClient.Builder client = new OkHttpClient.Builder();
          HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
          loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
          client.addInterceptor(loggingInterceptor);
          Retrofit retrofit = new Retrofit.Builder()
                  .baseUrl(BASE_URL)
                  .client(client.build())
                  .addConverterFactory(GsonConverterFactory.create())
                  .build();
  
          //Retrofit retrofit = new Retrofit.Builder()
          //        .baseUrl(BASE_URL)
          //        .addConverterFactory(GsonConverterFactory.create())
          //        .build();
  
          return retrofit;
      }
  }
  
  public interface ApiInterface {
      @GET("json")
      Call&lt;ApiTimes&gt; getTime(@Query("location") String location, @Query("timestamp") String timestamp, @Query("key") String key);
  }
  </code></pre>