public ResponseEntity<String> getGetResponse(URI uri, String wamUsername) {
RestTemplate restTemplate = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
headers.add("Accept", "application/hal+json");
headers.add("Authorization", authHeaders.getAuth());
headers.add("wam-authenticated-username", wamUsername);
HttpEntity<String> entity = new HttpEntity<String>("parameters", headers);
return restTemplate.exchange(uri, HttpMethod.GET, entity, String.class);
}
public ResponseEntity<?> getPostResponse(URI uri, String wamUsername, Object obj) {
RestTemplate restTemplate = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
headers.add("Accept", "application/hal+json");
headers.add("Authorization", authHeaders.getAuth());
headers.add("wam-authenticated-username", wamUsername);
HttpEntity<Object> entity = new HttpEntity<Object>(obj, headers);
return restTemplate.exchange(uri, HttpMethod.POST, entity, Object.class);
}