Expand description
HTTP utilities for CBOR and Candid RPC calls.
This module provides functionality for:
- Making CBOR-encoded RPC calls;
- Making Candid-encoded canister calls;
- Handling HTTP requests and responses;
- Error handling for RPC operations.
The main types are:
RPCRequest: Represents a generic RPC request with CBOR-encoded parameters;CanisterRequestRef: Represents a canister-specific request with Candid-encoded parameters;RPCResponse: Represents a response from an RPC call;HttpRPCError: Represents possible errors during RPC operations.
The main functions are:
http_rpc: Makes a generic CBOR-encoded RPC call;canister_rpc: Makes a canister-specific RPC call with Candid encoding;cbor_rpc: Internal function for making CBOR-encoded HTTP requests.
Structs§
- Canister
Request Ref - Borrowed request to an ICP canister with Candid-encoded parameters.
- List
Object - Paginated list response.
- RPCRequest
- Owned RPC request with a method name and CBOR-encoded parameters.
- RPCRequest
Ref - Borrowed RPC request with a method name and CBOR-encoded parameters.
Enums§
- HttpRPC
Error - Errors returned by
http_rpc,canister_rpc, andcbor_rpc.
Constants§
- CONTENT_
TYPE_ CBOR - MIME type used for CBOR-encoded RPC request and response bodies.
- CONTENT_
TYPE_ JSON - MIME type used for JSON HTTP request and response bodies.
- CONTENT_
TYPE_ TEXT - MIME type used for plain text HTTP response bodies.
- MAX_
RPC_ RESPONSE_ BYTES - Maximum size, in bytes, accepted for a CBOR RPC success response body.
Functions§
- canister_
rpc - Calls a canister method through a remote endpoint using Candid-encoded arguments.
- cbor_
rpc - Sends a raw CBOR RPC request and returns the remote payload.
- http_
rpc - Calls a remote CBOR RPC method and decodes its CBOR response payload.
Type Aliases§
- RPCResponse
- RPC response payload returned by remote engines.