title: Error with HTTP Connection: close header
body: <p>I am having a weird problem with a small restlet service that I am building as an exercise. The application is supposed to respond with some XML (<a href="https://www.twilio.com/docs/api/twiml" rel="nofollow">specifically TwiML</a>, as it is meant for Twilio) on an HTTP POST, and it worked well for standalone requests. However, when requested by Twilio, the response never completes and it times out. After comparing the traffic coming from Twilio with the one that is working (using a fake HTML form), I isolated the issue to the "Connection: close" header and can reproduce it using nothing but curl command-line. Here is the request that works:</p>
  
  <pre><code>curl -i -H 'Connection: keep-alive' -X POST -d "name=value" http://localhost:8020/hello
  </code></pre>
  
  <p>and here is the one that just hangs:</p>
  
  <pre><code>curl -i -H 'Connection: close' -X POST -d "name=value" http://localhost:8020/hello
  </code></pre>
  
  <p>If I kill the server then curl says "(52) Empty reply from server". Here is the code that I am using in the ServerResource:</p>
  
  <pre><code>@Post
  public Representation hello(Representation repr)
  {
      Representation result = new StringRepresentation(("&lt;Response&gt;\n"+
              "   &lt;Say&gt;Hello. This is a test.&lt;/Say&gt;\n"+
              "&lt;/Response&gt;"), MediaType.APPLICATION_XML);
      return result;
  }
  </code></pre>
  
  <p>Is something obviously wrong with what I am doing here? I am using restlet-2.0, but also tried with 2.1m1 with the same result. I would really appreciate a quick response as I am on a deadline to finish the exercise.</p>