I am trying to connect an endpoint which is in other profile and it defined as following:
@DeleteMapping("/persons")
public ResponseEntity<Boolean> deletePersons(@RequestBody List<Persons> persons) {
I send a resttemplate as following but it does not work:
public ResponseEntity<Boolean> deletePersons(List<Persons> persons) {
HttpHeaders headers = new HttpHeaders();
headers.setAccept(Collections.singletonList(MediaType.APPLICATION_OCTET_STREAM));
HttpEntity<?> httpEntity = new HttpEntity<>("persons", headers);
return restTemplate.exchange(url, HttpMethod.DELETE, httpEntity, Boolean.class,
persons);
}
i am getting the following error:
No HttpMessageConverter for java.lang.String
Aucun commentaire:
Enregistrer un commentaire