filmov
tv
@ResponseStatus to Set HTTP Status Code
Показать описание
@ResponseStatus to Set HTTP Status Code. There is explanation about how you can set HTTP response in spring and spring boot for API.
@RequestMapping("/bad")
@ResponseStatus(code = HttpStatus.BAD_REQUEST, reason = "Some parameters are invalid")
void onIllegalArgumentException(IllegalArgumentException exception) {}
@RequestMapping("/bad")
@ResponseStatus(code = HttpStatus.BAD_REQUEST, reason = "Some parameters are invalid")
void onIllegalArgumentException(IllegalArgumentException exception) {}