How to extract HTTP status code from the RestTemplate call to a URL?
问题 I am using RestTemplate to make an HTTP call to our service which returns a simple JSON response. I don't need to parse that JSON at all. I just need to return whatever I am getting back from that service. So I am mapping that to String.class and returning the actual JSON response as a string. RestTemplate restTemplate = new RestTemplate(); String response = restTemplate.getForObject(url, String.class); return response; Now the question is - I am trying to extract HTTP Status codes after