title: Content-length is null for EntityTemplate
body: <p><strong>Scope:</strong> I'm using http apache libraries included in Android and trying to execute HttpPost via HttpClient with HttpEntity, made from EntityTemplate with ContentProducer.
  Here is <strong>the code</strong>:</p>
  
  <pre><code>    HttpClient httpClient = new CustomHttpsClient().getNewHttpClient();
      HttpPost httpPost = new HttpPost("APP_URI");
      HttpEntity postEntity;
      HttpEntity getEntity;
  
      ContentProducer contentProducer = new ContentProducer() {
  
          @Override
          public void writeTo(OutputStream outstream) throws IOException {
              // TODO Auto-generated method stub
              Writer writer = new OutputStreamWriter(outstream, "UTF-8");
              writer.write("&lt;req version=\"1.0\" lang=\"RU\"&gt;");
              writer.write("&lt;act&gt;o_addcard&lt;/act&gt;");
              writer.write("&lt;/req&gt;");
              writer.flush();
          }
      };
  
      postEntity = new EntityTemplate(contentProducer);
      httpPost.setEntity(postEntity);
  
      String responseEntity;
      try {
          HttpResponse httpResponse = httpClient.execute(httpPost);
          ...} catch(...){...}
  </code></pre>
  
  <p><strong>Problem:</strong> Server always gives me 411 response code (Content-length is null):</p>
  
  <blockquote>
    <p>"POST / HTTP/1.1" 411 180 "-" "-"</p>
  </blockquote>
  
  <p>These code works on some servers. But why content-length is always null?
  Also we can't set it manually, otherwise we have exception Caused by: </p>
  
  <blockquote>
    <p>Caused by: org.apache.http.ProtocolException: Content-Length header already present</p>
  </blockquote>
  
  <p>Many thanks for your answers!</p>