title: Retrofit 2 - null response body
body: <p>I am trying to convert following response with <code>Retrofit 2</code></p>
  
  <pre><code>{
      "errorNumber":4,
      "status":0,
      "message":"G\u00f6nderilen de\u011ferler kontrol edilmeli",
      "validate":[
          "Daha \u00f6nceden bu email ile kay\u0131t olunmu\u015f. L\u00fctfen giri\u015f yapmay\u0131 deneyiniz."
      ]
  }
  </code></pre>
  
  <p>But I am allways getting <code>null</code> response in <code>onResponse</code> method. So I tried to look at error body of the response with <code>response.errorBody.string()</code>. Error body contains exactly same content with raw response.</p>
  
  <p>Here is my service method, <code>Retrofit</code> object and response data declerations:</p>
  
  <pre><code>@FormUrlEncoded
  @POST("/Register")
  @Headers("Content-Type: application/x-www-form-urlencoded")
  Call&lt;RegisterResponse&gt; register(
          @Field("fullName")  String fullName,
          @Field("email")     String email,
          @Field("password")  String password);
  
  public class RegisterResponse {
      public int status;
      public String message;
      public int errorNumber;
      public List&lt;String&gt; validate;
  }
  
  OkHttpClient client = new OkHttpClient();
  client.interceptors().add(new Interceptor() {
      @Override
      public Response intercept(Chain chain) throws IOException {
          Response response = chain.proceed(chain.request());
          final String content = UtilityMethods.convertResponseToString(response);
          Log.d(TAG, lastCalledMethodName + " - " + content);
          return response.newBuilder().body(ResponseBody.create(response.body().contentType(), content)).build();
      }
  });
  Retrofit retrofit = new Retrofit.Builder()
          .baseUrl(BASE_URL)
          .addConverterFactory(GsonConverterFactory.create())
          .client(client)
          .build();
  domainSearchWebServices = retrofit.create(DomainSearchWebServices.class);
  </code></pre>
  
  <p>I have controlled response <code>JSON</code> with <a href="http://www.jsonschema2pojo.org/"><code>jsonschema2pojo</code></a> to see if I modled my response class wright and it seems OK.</p>
  
  <p>Why Retrofit fails to convert my response?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>For now as a work around I am building my response from error body.</p>