@PutMapping
Learn @PutMapping (Controllers, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Fresher Notes @PutMapping maps HTTP PUT requests; it is the shortcut for @RequestMapping(method = RequestMethod.PUT) and is used to replace a whole resource. Full replacement : the client sends the complete new state of the resource at a known URL such as /users/5 . Response : 200 OK with the body, or 204 No Content; 404 when the id does not exist.
More lessons in Controllers
- @Controller
- @RestController
- Controller Lifecycle
- Controller Methods
- Request Mapping
- @RequestMapping
- @GetMapping
- @PostMapping
- @DeleteMapping
- @PatchMapping
- Mapping HTTP Methods
- Mapping URL Paths
- Class-Level Mapping
- Method-Level Mapping
- Multiple URL Mappings
- Consumes
- Produces
- Mini Project: Controller Types and Mapping Rules