spring-framework / org.springframework.web.bind.annotation / ResponseStatus / code

code

@AliasFor("value") val code: HttpStatus

The status code to use for the response.

Default is HttpStatus#INTERNAL_SERVER_ERROR, which should typically be changed to something more appropriate.

Since
4.2

See Also
javax.servlet.http.HttpServletResponse#setStatus(int)javax.servlet.http.HttpServletResponse#sendError(int)