title: Retrofit returns content length 0 with spring data rest
body: <p>I am using spring boot application with spring data rest deployed on heroku. I have a /api/userDatas end point on which an entity can be created by a POST request. I have tested it using Postman and it gets created. </p>
  
  <p>Now I am using retrofit on android to perform the same functionality. But the problem is that entity gets created on the server but onFailure() always gets called. I have debugged and found that content-length is always 0. </p>
  
  <p>CreateUser</p>
  
  <pre><code>private void createUser() {
          Gson gson = new GsonBuilder()
                  .setLenient()
                  .create();
  
          HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
          logging.setLevel(HttpLoggingInterceptor.Level.BODY);
          OkHttpClient client = new OkHttpClient.Builder().addInterceptor(logging).build();
  
          Retrofit retrofit = new Retrofit.Builder()
                  .baseUrl(ServeNetworking.ServeURLS.getBaseURL())
                  .addConverterFactory(GsonConverterFactory.create())
                  .client(client)
                  .build();
  
  
          ServeNetworking serveNetworking = retrofit.create(ServeNetworking.class);
          Call&lt;UserData&gt; getUserByIdResponseCall = serveNetworking.socialConnectAPI(userData);
          getUserByIdResponseCall.enqueue(new Callback&lt;UserData&gt;() {
              @Override
              public void onResponse(Call&lt;UserData&gt; call, Response&lt;UserData&gt; response) {
                  Log.d("getUserById", "onResponse");
                  Toast.makeText(OTPVerificationActivity.this, "userId : onResponse", Toast.LENGTH_LONG).show();
                  /**
                   * Save data in local db and navigate to map screen.
                   */
  
                  ActivityAnimationUtils.presentActivity(OTPVerificationActivity.this, MapActivity.class);
  
                  try{
                      DBManager.getDBManager(OTPVerificationActivity.this).setIsVerified(true);
                  } catch (Exception e){
                      e.printStackTrace();
                  }
  
              }
  
              @Override
              public void onFailure(Call&lt;UserData&gt; call, Throwable t) {
                  Log.d("getUserById", "onFailure");
                  Utils.showSnackBar(OTPVerificationActivity.this,"Somethign went wrong", root);
              }
          });
      }
  </code></pre>
  
  <p>and interface:</p>
  
  <pre><code>public interface ServeNetworking {
  
      @POST("/api/userDatas")
      @Headers({ "Content-Type: application/json;charset=UTF-8"})
      Call&lt;UserData&gt; socialConnectAPI(
              @Body UserData user
      );
  
      @GET("/api/userDatas/{userId}")
      @Headers({ "Content-Type: application/json; charset=utf-8"})
      Call&lt;UserData&gt; getUser(
              @Path("userId") String userId
      );
  
  
      /**
       * this class is used to get the donor base urls...
       */
      class ServeURLS{
          private static String baseURL="https://fabrimizer-serve.herokuapp.com";
  
          public static String getBaseURL() {
              return baseURL;
          }
  
      }
  }
  </code></pre>
  
  <p>I am getting following error:</p>
  
  <pre><code>java.io.EOFException: End of input at line 1 column 1 path $
  </code></pre>