@RequestMapping, @GetMapping, @PostMapping
Annotations that map an incoming HTTP request (method + path) to a specific controller method.
@RequestMapping("/api/orders") // base path for the whole class
@GetMapping // GET /api/orders
@GetMapping("/{id}") // GET /api/orders/{id}
@PostMapping // POST /api/orders
@PutMapping("/{id}") // PUT /api/orders/{id}
@DeleteMapping("/{id}") // DELETE /api/orders/{id}
- @GetMapping/@PostMapping/etc. are shorthand for @RequestMapping(method = ...)
- Class-level @RequestMapping sets a shared base path for every method below it