목차 @RestController public class TestController { @GettMapping("/test") @ResponseStatus(HttpStatus.BAD_REQUEST) public void getMethod() { } } @ResponseStatus를 붙여 상태코드를 지정해 줄 수 있다. 지정하지 않을시 상태코드는 기본값 200 ok이다. 공유하기 게시글 관리 개발블로그 목차 목차 닫기