From 0a9d87feb7cb5968a4a0409af4ca11b10e725c54 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Wed, 3 Jun 2026 14:22:27 +0000 Subject: [PATCH] feat: allow PATCH in http_request for non-replicated calls Mirrors dfinity/portal#6199 (PUT/DELETE). PATCH is a mutation, so like PUT/DELETE it is restricted to non-replicated mode (a replicated outcall is sent once per replica; PATCH is not guaranteed idempotent per RFC 5789). Requested in dfinity/portal#6244. Migrated from dfinity/portal#6245. NOTE: The changelog entry uses 0.63.0 because developer-docs already has a 0.62.0 entry with different content. The correct version number needs human confirmation before this PR is merged. Co-Authored-By: Claude --- docs/references/ic-interface-spec/changelog.md | 3 +++ docs/references/ic-interface-spec/management-canister.md | 4 ++-- public/references/ic.did | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/references/ic-interface-spec/changelog.md b/docs/references/ic-interface-spec/changelog.md index 118a5c85..4ac3dfc9 100644 --- a/docs/references/ic-interface-spec/changelog.md +++ b/docs/references/ic-interface-spec/changelog.md @@ -8,6 +8,9 @@ sidebar: ## Changelog {#changelog} +### 0.63.0 (TBD) {$0_63_0} +* Support for the HTTP method `PATCH` in canister `http_request` in non-replicated mode. + ### 0.62.0 (2025-05-26) {$0_62_0} * Inter-canister response callback messages might still be executed after the condition for `canister_on_low_wasm_memory` is triggered and before the function `canister_on_low_wasm_memory` is executed. diff --git a/docs/references/ic-interface-spec/management-canister.md b/docs/references/ic-interface-spec/management-canister.md index db9f000d..d5741a93 100644 --- a/docs/references/ic-interface-spec/management-canister.md +++ b/docs/references/ic-interface-spec/management-canister.md @@ -640,7 +640,7 @@ In the replicated mode, the responses for all identical requests must match, too For this reason, the calling canister can supply a transformation function, which the IC uses to let the canister sanitize the responses from such unique values. The transformation function is executed separately on the corresponding response received for a request (both in replicated and non-replicated modes). Only the transformed response will be available to the calling canister. -Currently, the `GET`, `HEAD`, and `POST` methods are supported for HTTP requests. Additionally, the `PUT` and `DELETE` methods are supported in non-replicated mode only. `PUT` and `DELETE` are restricted to non-replicated mode to avoid confusing race conditions that may occur with replicated execution. +Currently, the `GET`, `HEAD`, and `POST` methods are supported for HTTP requests. Additionally, the `PUT`, `DELETE`, and `PATCH` methods are supported in non-replicated mode only. `PUT`, `DELETE`, and `PATCH` are restricted to non-replicated mode to avoid confusing race conditions that may occur with replicated execution. It is important to note the following for the usage of the `POST` method: @@ -664,7 +664,7 @@ The following parameters should be supplied for the call: - `max_response_bytes` - optional, specifies the maximal size of the response in bytes. If provided, the value must not exceed `2MB` (`2,000,000B`). The call will be charged based on this parameter. If not provided, the maximum of `2MB` will be used. -- `method` - currently, `GET`, `HEAD`, and `POST` are supported. Additionally, `PUT` and `DELETE` are supported in non-replicated mode only. +- `method` - currently, `GET`, `HEAD`, and `POST` are supported. Additionally, `PUT`, `DELETE`, and `PATCH` are supported in non-replicated mode only. - `headers` - list of HTTP request headers and their corresponding values diff --git a/public/references/ic.did b/public/references/ic.did index 734ee61f..519d1c05 100644 --- a/public/references/ic.did +++ b/public/references/ic.did @@ -344,7 +344,7 @@ type deposit_cycles_args = record { type http_request_args = record { url : text; max_response_bytes : opt nat64; - method : variant { get; head; post; put; delete }; + method : variant { get; head; post; put; delete; patch }; headers : vec http_header; body : opt blob; transform : opt record {