To customize the response body of a Spring Boot controller method, the @_____ annotation can be used.
- @Response
- @ResponseBody
- @ResponseController
- @ResponseEntity
To customize the response body of a Spring Boot controller method, the @ResponseBody annotation is used. This annotation tells Spring that the return value of the method should be bound to the web response body, allowing you to customize the content that is sent back to the client. It's a key annotation for building RESTful web services with Spring Boot.
Loading...
Related Quiz
- Which utility is commonly used in Spring Boot for performing HTTP requests in test scenarios?
- For a service to register itself with Eureka, it must have the _____ annotation in its main application class.
- What considerations should be taken into account when choosing between Flyway and Liquibase for a large-scale, complex Spring Boot application?
- In Spring Boot, the _____ annotation is used to specify that a class is a candidate for component scanning.
- In a Spring Boot application, how can you handle exceptions that are thrown during the data binding process?