- 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.
推薦閱讀
- GraphQL學習指南
- Visual Basic程序開發(學習筆記)
- Learning Selenium Testing Tools with Python
- Python 深度學習
- INSTANT Weka How-to
- R語言數據可視化實戰
- Quarkus實踐指南:構建新一代的Kubernetes原生Java微服務
- Drupal 8 Configuration Management
- Hands-On Full Stack Development with Go
- iOS開發實戰:從入門到上架App Store(第2版) (移動開發叢書)
- Linux C編程:一站式學習
- Python從入門到精通
- Getting Started with Python and Raspberry Pi
- Visual Studio Code 權威指南
- Node.js 12實戰