Getting InputStream with RestTemplate
问题 I am using URL class to read an InputStream from it. Is there any way I can use RestTemplate for this? InputStream input = new URL(url).openStream(); JsonReader reader = new JsonReader(new InputStreamReader(input, StandardCharsets.UTF_8.displayName())); How can I get InputStream with RestTemplate instead of using URL ? 回答1: You should not get the InputStream directly. RestTemplate is meant to encapsulate processing the response (and request) content. Its strength is handling all the IO and