Skip to main content

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