@PostMapping(path = "/test")
public void save(Map payload) {
testService.save(payload);
}
Spring RestController returns 204 instead of 200 in above scenario. Return type is void & there is no content is response body. It is an established practice to return 204 HTTP code when there is no response body & the processing is successful. I want to know why Spring doesn't do that by default? Is there any particular reason?
I already know how to change the default status code, so that is not a question.