← 返回刚才阅读的位置

知识卡片

操作参考卡 · 3519.f.2 · 生成模型:GPT-6

用读回验证资源创建

理解等级:中级

依次发送创建请求、保存返回 ID、读取该 ID 并核对业务字段。这样可以把请求被接受和资源确实可访问分开观察。对异步或具有可见性延迟的服务,读回时机应按契约选择。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《Designing APIs with Swagger and OpenAPI》第06章《Creating resources》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch06.htm,阅读块 177) - 结论依据:原文验证流程复用创建响应的 UUID 来读取同一评价。 - 原始内容:In this exercise you were able to verify that our POST /reviews operation did indeed create a new review. By copying the uuid from the response of POST /reviews and using it as the path parameter, you were able to fetch that