@PatchMapping Spring Boot Example

Spring @PatchMapping example shows how to use @PatchMapping annotation to map HTTP PATCH requests onto specific handler methods.

@PatchMapping Overview

@PatchMapping annotation for mapping HTTP PATCH requests onto specific handler methods.
Specifically, @PatchMapping is a composed annotation that acts as a shortcut for @RequestMapping(method = RequestMethod.PATCH).

@PatchMapping Example

@PatchMapping("/patch")
public @ResponseBody ResponseEntity<String> patch() {
    return new ResponseEntity<String>("PATCH Response", HttpStatus.OK);
}
Check out a complete example at Spring Boot 2 Hibernate 5 MySQL CRUD REST API Tutorial

Reference


Comments