Spring HATEOAS
Spring HATEOAS 是一个用于支持实现超文本驱动的 REST Web 服务的开发库。是 HATEOAS 的实现。
示例代码:
@Controller @RequestMapping("/people") class PersonController { @RequestMapping(method = RequestMethod.GET) public HttpEntity<PersonResource> showAll() { … } @RequestMapping(value = "/{person}", method = RequestMethod.GET) public HttpEntity<PersonResource> show(@PathVariable Long person) { … } }
评论