beginnerSpring MVC Annotations
What do @PostMapping and @RequestBody do together in a Spring Boot REST controller?
@PostMapping maps an HTTP POST request to a handler method — typically used for creating a new resource. @RequestBody tells Spring to deserialize the incoming HTTP request body (usually JSON) directly into a Java object parameter, using Jackson under the hood — together they let a method like createUser(@RequestBody UserDto dto) receive a JSON payload as a fully-populated object with zero manual parsing code.
This is a Pro question
Sign in, then upgrade to Pro or Power to unlock this question and the full Interview Prep bank.
What do @PostMapping and @RequestBody do together in a Spring Boot REST controller?