Hey, after updating our micro-service that used Spring 3.5.0 to Spring 3.5.3 sending DELETE requests with bodies has stopped working. The service on the receiving end is receiving the request without the body. The only change between the scenarios is the Spring version on the service that sent the request. The code for sending the request:
protected <T, K> boolean sendDeleteRequest(String url, T requestBody, ParameterizedTypeReference<K> responseType) {
boolean retVal = false;
HttpEntity<T> httpEntity = new HttpEntity<>(requestBody);
try {
ResponseEntity<K> result = restTemplate.exchange(
url,
HttpMethod.DELETE,
httpEntity,
responseType
);
if (result.getStatusCode().is2xxSuccessful()) {
log.debug("Successfully sent DELETE request to: {}", url);
retVal = true;
} else {
String errorMessage = String.format("Error while sending DELETE request to: %s, response: %s",
url, result.getStatusCode());
log.error(errorMessage);
}
} catch (Exception ex) {
log.error("Error while sending DELETE request to: {}", url, ex);
}
return retVal;
}
Where restTemplate is: org.springframework.web.client.RestTemplate.
Has something changed between 3.5.0 to 3.5.3 in that sense? I haven't noticed this in the changelog.
Comment From: bclozel
This has been fixed in https://github.com/spring-projects/spring-framework/issues/35068 already, shipped with Spring Boot 3.5.4.