Folks...
the curl line: curl https://api.storify.com/v1/stories/storify
produces a lengthy JSON response from storify. My attempt to translate this to Spring's RestTemplate looks like this:
@Test
public void test() {
RestTemplate template = new RestTemplate();
URI uri=URI.create("https://api.storify.com/v1/stories/storify");
ResponseEntity<String> response = template.getForEntity(uri,String.class);
System.out.println("<<<<<<<<<<");
System.out.println(response.getStatusCode()+" "+response.hasBody());
System.out.println("<<<<<<<<<<");
String text = response.getBody();
System.out.println(response.getBody());
System.out.println("<<<<<<<<<<");
}
While the resulting status code is 200, and hasBody()
is true, the getBody()
isn't returning anything but seemingly an empty line. How can I replicate the results of the curl using RestTemplate
?
Thanks, GeePaw