DELETE request using WP REST API

https://{site}.com/wp-json/wp/v2/posts/{id}

        	HttpHeaders headers = new HttpHeaders();
        	headers.setContentType(MediaType.APPLICATION_JSON);
        	headers.add("Authorization","Bearer "+token);
        	String urlToUse=UriComponentsBuilder.fromHttpUrl(deleteposturl).buildAndExpand(site,Id).toString();
	
	        HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<MultiValueMap<String, String>>(null, headers);

	        RestTemplate restTemplate = new RestTemplate();
        	response = restTemplate.delete( urlToUse, request );