title: Spring RestTemplate getForObject getting 404
body: <p>I'm trying to make a get request to an Api Rest but I'm always getting 404, nevertheless if try copying  queryUrl  in a browser or postMan it works perfectly.</p>
  
  <pre>restTemplate.getForObject(queryUrl, entity ,Integer.class);
  </pre>
  
  <p>I've also tried this:</p>
  
  <pre>
  HttpHeaders httpHeaders = new HttpHeaders();
  httpHeaders.setContentType(MediaType.APPLICATION_JSON);
  HttpEntity entity = new HttpEntity(httpHeaders);
  log.debug("request headers: " + entity.getHeaders());
  ResponseEntity response = restTemplate.exchange(queryUrl, 
  HttpMethod.GET, entity, String.class);
  </pre>
  
  <p>But nothing changes. 
  Can anyone help me?</p>