@DeleteMapping

From NovaOrdis Knowledge Base
Revision as of 03:14, 13 March 2019 by Ovidiu (talk | contribs) (→‎REST)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Internal

Overview

The annotation may also contain a sub-path relative to the class-level base path, usually configured with @RequestMapping.

REST

@RestController
@RequestMapping(path = "/a", produces = "application/json")
public class AController {

  @DeleteMapping(path = "/{id}")
  @ResponseStatus(code = HttpStatus.NO_CONTENT)
  public void delete(@PathVariable("id") Integer id) {
    content.remove(id);
  }
}

HTTP DELETE Semantics for REST Applications

HTTP DELETE Semantics for REST Applications