Which of the following annotations can be used to customize the response body in a Spring Boot application?

  • @RequestBody
  • @RequestMapping
  • @ResponseBody
  • @RestController
The @ResponseBody annotation in Spring Boot is used to customize the response body of a controller method. It allows you to return data in various formats, such as JSON, XML, or plain text, depending on the media type specified. This annotation is commonly used in RESTful API development to control the format of the response data.
Add your answer
Loading...

Leave a comment

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