title: How to properly read POST request body in a Handler?
body: <p>The code I'm using now:</p>
  
  <pre><code>    Pooled&lt;ByteBuffer&gt; pooledByteBuffer = exchange.getConnection().getBufferPool().allocate();
      ByteBuffer byteBuffer = pooledByteBuffer.getResource();
  
      int limit = byteBuffer.limit();
  
      byteBuffer.clear();
  
      exchange.getRequestChannel().read(byteBuffer);
      int pos = byteBuffer.position();
      byteBuffer.rewind();
      byte[] bytes = new byte[pos];
      byteBuffer.get(bytes);
  
      String requestBody = new String(bytes, Charset.forName("UTF-8") );
  
      byteBuffer.clear();
      pooledByteBuffer.free();
  </code></pre>
  
  <p>It seems to work OK but I'm not sure about the need to <code>clear()</code> ByteBuffer before returning it to the pool. I'm not even sure about using <code>exchange.getConnection().getBufferPool().allocate();</code>. There is not much about it in the documentation.</p>