知识卡片
Richardson四级模型
Richardson 模型按接口对资源、HTTP 方法和超媒体的使用分为四级:单一 URI 上的 HTTP/RPC、可标识资源、方法表达操作、响应携带后续动作。级别可用来检查设计特征,却不能单独判定 API 质量;本书把接近第二级视作许多服务接口的实用目标。
结构图:
flowchart LR
A[0 单一URI上的调用] --> B[1 资源标识]
B --> C[2 HTTP方法表达操作]
C --> D[3 超媒体给出后续动作]
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
- · 消费者与接口风格
原书出处 · 1 处
- · 查看原书依据
Level 0 - HTTP/RPC Establishes that the API is built using HTTP and has the notion of a single URI. Taking our preceding example of /attendees and not applying a verb to specify intent, we would open up an endpoint for exchange. Essentially this represents an RPC implementation over the REST protocol. Level 1 - Resources Establishes the use of resources and starts to bring in the idea of modeling resources in the context of the URI.
参考来源
- 位置:《Mastering API Architecture》第1章《Design, Build, and Specify APIs》之《The Richardson Maturity Model》(源文件:_epub-src/OEBPS/ch01.xhtml)
- 结论依据:原文表 1-1 依次列 Level 0–3 的特征,并在后文明确推荐向 Level 2 的资源与方法建模靠近;图仅重述该分级顺序。
- 原始内容:Level 0 - HTTP/RPC Establishes that the API is built using HTTP and has the notion of a single URI. Taking our preceding example of /attendees and not applying a verb to specify intent, we would open up an endpoint for exchange. Essentially this represents an RPC implementation over the REST protocol. Level 1 - Resources Establishes the use of resources and starts to bring in the idea of modeling resources in the context of the URI.