← 返回卡片

原书出处

RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)

03 超媒体接口设计

First Edition · 核验版本的摘录快照 · 导入于 2026-11-14T06:41:15.484Z

The second thing you can do is design write operations themselves to support idempotences. This often means not using patterns like increments (“add one to each total”) or computing percentages (“increase the sale price by 5%”) and instead using replacement values and validators (“if the current price is 100, change it to 105”). By relying on HTTP’s PUT to update a resource and by designing the body of updates to use replacement rather than increment, you can increase the repeatability of the write operations for your service interface.

此预览只包含定位所需的摘录和上下文。

原书定位详情

来源:a19c7933-4eda-4176-aebd-30fe7e1ad292

正文位置:extracted/RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)/_epub-src/OEBPS/ch03.xhtml

EPUB SHA-256:db552473a29e61f8a9429a17bbb5c0a47985d7cbbfd2d402bce45fc4b11ee389