Skip to content

Instantly share code, notes, and snippets.

@sabesansathananthan
Created August 8, 2019 17:22
Show Gist options
  • Save sabesansathananthan/e957416e51d4eb8531ba6e10656fa843 to your computer and use it in GitHub Desktop.
Save sabesansathananthan/e957416e51d4eb8531ba6e10656fa843 to your computer and use it in GitHub Desktop.
Client Application
@Service
class SampleClient {
@Value("${app.access-url}")
private String endpoint;
private RestTemplate restTemplate;
public SampleClient(RestTemplate restTemplate) {
this.restTemplate = restTemplate;
}
void setRestTemplate(RestTemplate restTemplate) {
this.restTemplate = restTemplate;
}
String getData() {
return restTemplate.getForObject(endpoint, String.class);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment