Link headers vs link elements for RESTful JSON

后端 未结 5 1608
余生分开走
余生分开走 2021-02-01 04:09

When building a RESTful / hypermedia API with JSON resources, it seems I have two options for specifying the hypermedia relationships between resources.

  1. Embed t

5条回答
  •  一个人的身影
    2021-02-01 04:33

    It seems to me using both alternatives (Link headers and hypermedia links in the response body following a standard format such as HAL) allows your solution to reap the benefits of both approaches. Of course that sounds like a good idea if your REST development framework supports automatic creation of the links in both places.

提交回复
热议问题