code: public static String getResponseContent(HttpResponse response) throws IOException {
          final HttpEntity entity = response.getEntity();
          if (entity != null) {
              try {
                  ByteArrayOutputStream out = new ByteArrayOutputStream();
                  entity.writeTo(out);//call this in any case!!!
                  return isScOk(response) ? new String(out.toByteArray(), Charset.forName("UTF-8")) : null;
              } finally {
                  //ensure entity is closed.
                  EntityUtils.consume(entity);
              }
          } else {
              return null;
          }
      }
docs: Get text content from the response if response status code is 200.
  @param response instance of HttpResponse.
  @return String representation of HttpEntity.
  @throws IOException if an I/O error occurs
  @see #isScOk(HttpResponse)