public static ResponseEntity<String> delete(String url, Map<String, String> headers) {
if (url == null || url.isEmpty()) {
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY).body("URL must not be null");
}
HttpHeaders httpHeaders = getHeadersFromMap(headers);
HttpEntity<Object> httpEntity = new HttpEntity<Object>(httpHeaders);
return REST_TEMPLATE.exchange(url, HttpMethod.DELETE, httpEntity, String.class);
}
You can
get the complete working application from this link.
No comments:
Post a Comment