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.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *