Skip to content

Commit 0a9d87f

Browse files
ggreifclaude
andcommitted
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 <noreply@anthropic.com>
1 parent 6704e80 commit 0a9d87f

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

docs/references/ic-interface-spec/changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ sidebar:
88

99
## Changelog {#changelog}
1010

11+
### 0.63.0 (TBD) {$0_63_0}
12+
* Support for the HTTP method `PATCH` in canister `http_request` in non-replicated mode.
13+
1114
### 0.62.0 (2025-05-26) {$0_62_0}
1215
* Inter-canister response callback messages might still be executed after the condition for `canister_on_low_wasm_memory` is triggered
1316
and before the function `canister_on_low_wasm_memory` is executed.

docs/references/ic-interface-spec/management-canister.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ In the replicated mode, the responses for all identical requests must match, too
640640

641641
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.
642642

643-
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.
643+
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.
644644

645645
It is important to note the following for the usage of the `POST` method:
646646

@@ -664,7 +664,7 @@ The following parameters should be supplied for the call:
664664

665665
- `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.
666666

667-
- `method` - currently, `GET`, `HEAD`, and `POST` are supported. Additionally, `PUT` and `DELETE` are supported in non-replicated mode only.
667+
- `method` - currently, `GET`, `HEAD`, and `POST` are supported. Additionally, `PUT`, `DELETE`, and `PATCH` are supported in non-replicated mode only.
668668

669669
- `headers` - list of HTTP request headers and their corresponding values
670670

public/references/ic.did

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ type deposit_cycles_args = record {
344344
type http_request_args = record {
345345
url : text;
346346
max_response_bytes : opt nat64;
347-
method : variant { get; head; post; put; delete };
347+
method : variant { get; head; post; put; delete; patch };
348348
headers : vec http_header;
349349
body : opt blob;
350350
transform : opt record {

0 commit comments

Comments
 (0)