title: Spring 4.1.0 RestTemplate POST call
body: <p>I am trying to make a rest call using spring 4.1.0 RestTemplate but i dont see HttpEntity class.</p>
  
  <pre><code>     HttpHeaders requestHeaders=new HttpHeaders();
       requestHeaders.set("Content-Type", "application/json");
       String str = new String();
          HttpEntity&lt;String&gt; requestEntity=new HttpEntity&lt;String&gt;(str,requestHeaders);
          RestTemplate restTemplate=new RestTemplate();
          URI location = restTemplate.postForLocation("http://example.com", requestEntity);
  </code></pre>
  
  <p>So there are 2 questions:</p>
  
  <blockquote>
    <ol>
    <li>How can i get access to HttpEntity class as its not found?</li>
    <li>how can i get the body or the response from URI?</li>
    </ol>
  </blockquote>
  
  <p>Kindly suggest</p>