title: Spring Rest Template body is null responseEntity.getBody()
body: <p>I am new to Spring and I am using version 4.3.0. In my code I am getting the body as null always when I call the method within another rest call. However when I test this method using postman it works perfectly fine. I am not sure what I am missing here. I looked into other similar questions and tried the HttpEntity options but still I am missing something here. </p>
  
  <p>Here is my code.</p>
  
  <pre><code>@RequestMapping(value = "/location/{uuid}", method = RequestMethod.GET)
  public ArrayList&lt;String&gt; getLocation(@PathVariable("uuid") String uuid) {
  
      String uriString = "http://user1:pass1@10.10.10.10/LocationProvider/api/" + uuid;
  
      try {
          HttpHeaders headers = new HttpHeaders();
          headers.setContentType(MediaType.APPLICATION_XML);
          HttpEntity&lt;?&gt; entity = new HttpEntity&lt;String&gt;(headers);
  
          ResponseEntity&lt;String&gt; responseEntity = restTemplate.exchange(uriString, HttpMethod.GET, entity, String.class);
          String locations = responseEntity.getBody();
  
          // THIS IS THE RESPONSE I GET IN POSTMAN BUT IN DEBUGGER ITS NULL
  //          &lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  //          &lt;Locations&gt;
  //              &lt;City name="New" street="First_Ave" state=""/&gt;
  //              &lt;City name="old" street="Second_Ave" state=""/&gt;
  //          &lt;/Locations&gt;
          return locations;
  
      } catch (RestClientException e) {
          logger.error(e.getMessage(), e);
          return null;
      } 
  }
  </code></pre>
  
  <p>Thank you very much for your help.</p>