HTTP Methods
Learn HTTP Methods (REST API Development, Spring Boot) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
One URL, Five Meanings In a REST API the URL names a thing ( /books/7 ) and the HTTP method says what you want to do to it. The same URL therefore does five different jobs depending on the method. Spring maps each one with its own annotation: @GetMapping , @PostMapping , @PutMapping , @PatchMapping and @DeleteMapping . The rest of this topic is about when to use which, because choosing the wrong one is the most common REST design mistake.
More lessons in REST API Development
- REST API & RESTful Web Services
- HTTP Status Codes
- Building REST APIs with Spring Boot
- Request Mapping Annotations
- Reading Request Data
- ResponseEntity
- DTOs: Request and Response
- API Design - Pagination, Filtering & Versioning
- JSON - Structure & Parsing
- REST API - Save & Update Operation
- REST API - Get & Delete Operation
- Spring Boot - Interceptor
- Mini Project: Book Catalogue REST API