When creating a custom error response in Spring Boot, the _____ method of the ResponseEntity class can be used to set the HTTP status code of the response.
- setHttpStatus
- status
- statusCode
- statusSet
When creating a custom error response in Spring Boot, you can use the status method of the ResponseEntity class to set the HTTP status code of the response. This allows you to return specific HTTP status codes along with custom error messages, providing clear information to clients about the nature of the error that occurred.
Loading...
Related Quiz
- The _____ annotation in Spring Boot is used to provide global exception handling across all @Controller classes.
- For creating custom auto-configuration in Spring Boot, the configuration class needs to be listed in the _____ file.
- In Spring Boot, to order the execution of validation groups, the _____ interface needs to be implemented along with defining a sequence list of groups.
- How can you create a custom query method in a Spring Data JPA repository?
- In OAuth2, what is the purpose of the Refresh Token?