title: How to Reuse HttpUrlConnection?
body: <p>I am interested in reusing an HttpUrlConnection (as part of a statefull protocol between server and client that I'm developing).
  I know that there is an Connection=keep-alive header for persistent http.
  Now, I want to know how to reuse such a conenction.
  I have written this code:</p>
  
  <pre><code>URL u = new java.net.URL("http://localhost:8080/Abc/Def");
  HttpURLConnection c = (HttpURLConnection) u.openConnection();
  c.setRequestMethod("GET");
  c.setRequestProperty("Connection", "keep-alive");
  c.setHeader("A","B");
  c.getInputStream() //here I see that server gets my messages (using DEBUG)
  c.setHeader("B","C"); //
  </code></pre>
  
  <p>Now how do I resend this "B" header to the server, I tried re-connect etc,but nothing gets it to work.</p>
  
  <p>And the server also perform <code>response.setHeader("Connection", "keep-alive");</code></p>
  
  <p>I've looked in many forums, but no one wrote about this. Maybe <code>HttpURLConnection</code> doesn't handle this?</p>