@ResponseStatus
Main
As we have described before, you can specify the response status for a specific endpoint by using the options
argument in its the route decorator. Although, it is also possible to specify a response status at a controller level, this means, it will be applied to all your endpoints inside your controller. This is achieved by using the @ResponseStatus
decorator.
Usage
Syntax:
The @ResponseStatus
decorator must always be located at a class level, otherwise it will have no effect.
Example:
Last updated