Skip to content

Instantly share code, notes, and snippets.

@donchan922
Created May 19, 2019 12:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donchan922/5c68b4c15d569129425776a0b10bf389 to your computer and use it in GitHub Desktop.
Save donchan922/5c68b4c15d569129425776a0b10bf389 to your computer and use it in GitHub Desktop.
@Service
public class DemoService {
private final RestTemplate restTemplate;
public DemoService(RestTemplateBuilder restTemplateBuilder) {
this.restTemplate = restTemplateBuilder.build();
}
public User findUserDetails(String name) {
return restTemplate.getForObject("https://xxx/{name}/details", User.class, name);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment