Answer the question
In order to leave comments, you need to log in
How to know that RestTemplate#delete(...) worked correctly?
This method returns void. How can I find out the status of the request ok/error?
With other methods like getForObject(), postForObject() everything is clear:
response = restTemplate.getForObject(<...>);
or
response = restTemplate.postForObject(<...>);
and then we extract the necessary fields from the response, for example:
response.getStatus();
Question: how to do the same for the delete() method?
Answer the question
In order to leave comments, you need to log in
As Ivan Sokolov said , if no errors were thrown, then everything is ok. If you are a developer of a rest service that you are pulling, then correct unit and integration tests can add confidence.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question