@PutMapping: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(→REST) |
||
Line 9: | Line 9: | ||
=REST= | =REST= | ||
<syntaxhighlight lang='java'> | |||
@RestController | |||
@RequestMapping(path = "/a", produces = "application/json") | |||
public class AController { | |||
@PutMapping(consumes = "application/json") | |||
public A put(@RequestBody A a) { | |||
// wholesale replacement, make sure the A instance is valid | |||
... | |||
} | |||
} | |||
</syntaxhighlight> | |||
==HTTP PUT Semantics for REST Applications== | ==HTTP PUT Semantics for REST Applications== | ||
{{Internal|REST_and_Hypermedia#PUT|HTTP PUT Semantics for REST Applications}} | {{Internal|REST_and_Hypermedia#PUT|HTTP PUT Semantics for REST Applications}} |
Revision as of 02:08, 13 March 2019
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 {
@PutMapping(consumes = "application/json")
public A put(@RequestBody A a) {
// wholesale replacement, make sure the A instance is valid
...
}
}