知识卡片
超媒体格式能力不同
超媒体格式对链接、表单和数据体的标准化程度不同。HAL主要规定链接,SIREN还规定动作表单,HTML、Collection+JSON与UBER覆盖的要素更多。选择格式时先确认客户端需要发现哪些信息;用HAL-FORMS或POD补齐缺口又会增加实现组合,不能把所有“支持超媒体”的格式视为可互换。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 附录C:标准的角色与能力差异 · 查看原书依据
All hypermedia formats are not equal. For example, the Hypertext Application Language (HAL) format standardizes link elements but does not standardize forms or data bodies. The Structured Interface for Representing Entities (SIREN) format standardizes links and forms, but not data bodies. HTML, Collection+JSON, and Uniform Basis for Exchanging Representations (UBER) standardize all three message elements. I’ve created some “hypermedia polyfill” formats to supplement SIREN (Profile Object Description) and HAL (HAL-FORMS) to help bridge the gaps, but these additions can complicate implementations.