title: Http response is failing to pick up response body
body: <p>When i send an application/json request using REST it returns:</p>
  
  <pre><code>Trace-ID=[] - Response {
    "url" : null,
    "httpMethod" : null,
    "headers" : {
      "Cache-Control" : [ "no-cache" ],
      "Pragma" : [ "no-cache" ],
      "Content-Type" : [ "application/json; charset=utf-8" ],
    },
    "body" : {
      "AccNum" : "123456789",
      "AccName" : "xxxxxx",
      "ResponseCode" : "000",
    },
    "status" : 200
  }
  String: "{
    "url" : null,
    "httpMethod" : null,
    "headers" : {
      "Cache-Control" : [ "no-cache" ],
      "Pragma" : [ "no-cache" ],
      "Content-Type" : [ "application/json; charset=utf-8" ],
    },
    "body" : {
      "AccNum" : "123456789",
      "AccName" : "xxxxxx",
      "ResponseCode" : "000",
    },
    "status" : 200
  }"
  
  </code></pre>
  
  <p>The problem is i cant return just the body but i get the whole response, how do i return the body only. When i call the .getBody it still doesn't return the body but returns the whole response and how do i map the response body to to my CustomerResponse class.</p>
  
  <p>My code for sending the request and receiving the response:</p>
  
  <pre><code>public CustomerResponse getDetails(String accNum){
  
          HttpHeaders headers = new HttpHeaders();
          headers.setContentType(MediaType.APPLICATION_JSON);
          Map&lt;String, Object&gt; map = new HashMap&lt;&gt;();
  
          map.put("AccSid", "123456789");
          map.put("CustAcc", accNum);
          HttpEntity&lt;Map&lt;String, Object&gt;&gt; request = new HttpEntity&lt;&gt;(map,
                  headers);
  
          try {
              ResponseEntity&lt;CustomerResponse&gt; response =
                      restTemplate.postForEntity(url, request,
                              CustomerResponse.class);
              return response.getBody()
  
          } catch (Exception ex) {
              if (ex instanceof HttpClientErrorException) {
                  if (((HttpClientErrorException) ex).getStatusCode() == HttpStatus.NOT_FOUND) {
                      return null;
                  }
              }
              log.error("Error occurred while sending request for account ID {}.", accNum,
                      ex);
              throw ex;
          }
      }
  </code></pre>