title: java httprequest getting the body from the request
body: <p>I receive a post request from client. This request contains some json data which I want to part on the server side. I have created the server using httpcore. HttpRequestHandler is used for handling the request. Here is the code I thought would work</p>
  
  <pre><code>    HttpEntity entity = ((HttpEntityEnclosingRequest)request).getEntity();
  
                      InputStream inputStream = entity.getContent();
  
                      String str = inputStream.toString();
  
                      System.out.println("Post contents: " + str);*/
  </code></pre>
  
  <p>But I cant seem to find a way to get the body of the request using the HttpRequest object. How can I extract the body from the request object ? Thanks</p>