Created
August 8, 2019 17:22
-
-
Save sabesansathananthan/e957416e51d4eb8531ba6e10656fa843 to your computer and use it in GitHub Desktop.
Client Application
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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