- Mastering ASP.NET Web API
- Mithun Pattankar Malendra Hurbuns
- 98字
- 2021-07-02 20:52:28
Level 3
In level 3, hypermedia is introduced into our responses, commonly referred to as HATEOAS (Hypertext As The Engine of Application State).
Let's go back to the POST example:
POST : diet/ate Response: { "id":"12789", "links":[{ "rel":"self", "href":"http://yoursitename/diet/12789 }, { "Rel":"self", "href":"http://yoursitename/diet/12789" }, "rel":"rating", "href":"http://yoursitename/diet/12789/rating/" ] }
The point of the link is that it lets the consumer know what actions it can carry out.
Although both endpoints look the same, the consumer will figure out that one is DELETE and the other is PUT.
The last link is the resource to rate the meal you added.
推薦閱讀
- Deploying Node.js
- Python數據可視化:基于Bokeh的可視化繪圖
- Mastering phpMyAdmin 3.4 for Effective MySQL Management
- Java編程指南:基礎知識、類庫應用及案例設計
- C#程序設計(慕課版)
- Mastering Apache Spark 2.x(Second Edition)
- Linux C編程:一站式學習
- RealSenseTM互動開發實戰
- HTML5秘籍(第2版)
- Python+Tableau數據可視化之美
- Mastering Adobe Captivate 7
- Flink核心技術:源碼剖析與特性開發
- Oracle SOA Suite 12c Administrator's Guide
- 測試工程師Python開發實戰
- Java Web 從入門到項目實踐(超值版)