Fetching Data
Use @GetMapping to retrieve resources. Use @PathVariable to extract data from the URL.
GET /users/5 -> @PathVariable Long id
Spring Boot 0 to Hero: The Complete Java Backend Masterclass
Use @GetMapping to retrieve resources. Use @PathVariable to extract data from the URL.
GET /users/5 -> @PathVariable Long id