强制 curl 重放可能再次执行真实的修改或删除操作
原文依据:3 处该 Skill 同时支持 POST、PUT、DELETE、PATCH,并要求用 curl 重放完全相同的方法、请求头和正文。示例 PATCH 会把外部条目标记为 active。文档没有要求使用测试环境、一次性资源、幂等键或提供方的 dry-run 模式。
如果目标是生产 API,验证步骤可能重复创建、修改或删除真实记录,也可能重复下单、付款、发信或触发其他不可逆操作。
该技能明确要求对实现的请求用 curl 重放相同的方法、请求头和正文,而适用方法包括 POST、PUT、DELETE、PATCH。示例 PATCH 会把外部条目的 active 状态改为 true。若开发时连接真实服务且请求会修改或删除数据,本地验证会再执行一次真实操作;可要求作者限定测试环境、dry-run、一次性测试资源或幂等保护。风险来自验证指令与写操作的组合,并不证明示例已经执行。
This skill covers the requirements for HTTP requests from the backend canister,including GET, HEAD, POST, PUT, DELETE, and PATCH. Use it whenever integratingwith an external API or service.查看另外 2 个位置
func setItemActive() : async OutCall.Response { await OutCall.httpRequest({ url = "https://api.example.com/items/123"; method = #patch; headers = [{ name = "Content-Type"; value = "application/json" }]; body = ?("{\"active\":true}".encodeUtf8()); maxResponseBytes = 100_000; transform; }); };Before considering an HTTP outcall complete, execute the equivalent requestlocally with `curl`. Do not rely only on remembered API documentation or on theMotoko code compiling. Every check below is required. If any check fails, theHTTP outcall is incomplete and MUST NOT proceed to deployment.1. **MUST test the exact request implemented in Motoko:** the same HTTP method, API version, endpoint path, query parameters, headers, and body. Testing a related endpoint or adding parameters that the implementation does not use is not valid verification.2. **MUST trace one representative user input end to end** through every