Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RestTemplate restTemplate = new RestTemplate();
- String customerAPIUrl = "http://localhost:9080/api/customer";
- HttpHeaders headers = new HttpHeaders();
- headers.set("Authorization", "Bearer " + accessToken); //accessToken can be the secret key you generate.
- headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
- HttpEntity <String> entity = new HttpEntity <> (requestJson, headers);
- ResponseEntity <String> response = restTemplate.exchange(customerAPIUrl, HttpMethod.GET, entity, String.class);
Advertisement
Add Comment
Please, Sign In to add comment