title: Extracting the post body from an HTTP response
body: <p>I am trying to use httpClient (by apache) to post and get data. Posting is absolutely fine and my code for that has no issues, however, I cannot say the same for getting data. </p>
  
  <p>The website I am trying to get data from is this: <a href="http://www.posttestserver.com/data/2013/04/16/01.13.04594755373" rel="nofollow">http://www.posttestserver.com/data/2013/04/16/01.13.04594755373</a></p>
  
  <p>I only want to receive the body of the post (i.e. the JSON string at the bottom starting with Recent Cases), however, the method I am currently using (and every method I find online) returns the time, source IP, headers and body (basically it returns everything). Is there anyway to parse the body of out this? I don't want to go through the returned string and tell it to look for the text "Begin Post Body", I want a natural method for doing this. Does that exist?</p>
  
  <p>TLDR: I only want it to return what's in the post body</p>
  
  <p>Here's my code:</p>
  
  <pre><code>import org.apache.http.HttpEntity;
  import org.apache.http.HttpResponse;
  import org.apache.http.client.ClientProtocolException;
  import org.apache.http.client.HttpClient;
  import org.apache.http.client.methods.HttpGet;
  import org.apache.http.impl.client.DefaultHttpClient;
  import org.apache.http.util.EntityUtils;
  
  public static void main(String[] args) throws ClientProtocolException, IOException{
  
      HttpClient httpclient = new DefaultHttpClient();
      HttpGet httpget = new HttpGet("http://www.posttestserver.com/data/2013/04/16/01.41.38521171013");
      HttpResponse response = httpclient.execute(httpget);
      HttpEntity entity = response.getEntity();
      System.out.println(EntityUtils.toString(entity));
  
  }
  </code></pre>
  
  <p>And here's what is returned:</p>
  
  <pre><code>Time: Tue, 16 Apr 13 01:41:38 -0700
  Source ip: 155.198.108.247
  
  Headers (Some may be inserted by server)
  UNIQUE_ID = UW0OwtBx6hIAACfjfl4AAAAA
  CONTENT_LENGTH = 7627
  CONTENT_TYPE = application/json
  HTTP_HOST = posttestserver.com
  HTTP_CONNECTION = close
  HTTP_USER_AGENT = Apache-HttpClient/4.2.4 (java 1.5)
  REMOTE_ADDR = 155.198.108.247
  REMOTE_PORT = 54779
  GATEWAY_INTERFACE = CGI/1.1
  REQUEST_METHOD = POST
  QUERY_STRING = 
  REQUEST_URI = /post.php
  REQUEST_TIME = 1366101698
  
  No Post Params.
  
  == Begin post body ==
  {"Recent Cases":[{"descript..etc etc"}]}
  == End post body ==
  </code></pre>
  
  <p>Any ideas?</p>