Untitled
unknown
plain_text
a year ago
623 B
6
Indexable
public LocationResponse getLocationDetails(String postcode) {
String endpoint = location + "/location/details"; // Ensure this URL is correctly formed
RestTemplate restTemplate = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<String> requestEntity = new HttpEntity<>("{\"postcode\":\"" + postcode + "\"}", headers);
ResponseEntity<LocationResponse> responseEntity = restTemplate.exchange(endpoint, HttpMethod.POST, requestEntity, LocationResponse.class);
return responseEntity.getBody(); // Return the response body
}Editor is loading...
Leave a Comment