Skip to content

HttpAgentOptions

Defined in: packages/core/src/agent/agent/http/index.ts:134

optional backoffStrategy: BackoffStrategyFactory

Defined in: packages/core/src/agent/agent/http/index.ts:181

The strategy to use for backoff when retrying requests


optional callOptions: Record<string, unknown>

Defined in: packages/core/src/agent/agent/http/index.ts:144


optional credentials: object

Defined in: packages/core/src/agent/agent/http/index.ts:160

name: string

optional password: string


optional fetch: {(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

Defined in: packages/core/src/agent/agent/http/index.ts:136

(input, init?): Promise<Response>

MDN Reference

URL | RequestInfo

RequestInit

Promise<Response>

(input, init?): Promise<Response>

MDN Reference

string | URL | Request

RequestInit

Promise<Response>


optional fetchOptions: Record<string, unknown>

Defined in: packages/core/src/agent/agent/http/index.ts:141


optional host: string

Defined in: packages/core/src/agent/agent/http/index.ts:148


optional identity: Identity | Promise<Identity>

Defined in: packages/core/src/agent/agent/http/index.ts:152


optional ingressExpiryInMinutes: number

Defined in: packages/core/src/agent/agent/http/index.ts:158

The maximum time a request can be delayed before being rejected.

5 minutes

optional logToConsole: boolean

Defined in: packages/core/src/agent/agent/http/index.ts:190

Whether to log to the console. Defaults to false.


optional retryTimes: number

Defined in: packages/core/src/agent/agent/http/index.ts:177

Number of times to retry requests before throwing an error

3

optional rootKey: Uint8Array<ArrayBufferLike>

Defined in: packages/core/src/agent/agent/http/index.ts:195

Alternate root key to use for verifying certificates. If not provided, the default IC root key will be used.


optional shouldFetchRootKey: boolean

Defined in: packages/core/src/agent/agent/http/index.ts:200

Whether or not the root key should be automatically fetched during construction. Defaults to false.


optional shouldSyncTime: boolean

Defined in: packages/core/src/agent/agent/http/index.ts:205

Whether or not to sync the time with the network during construction. Defaults to false.


optional useQueryNonces: boolean

Defined in: packages/core/src/agent/agent/http/index.ts:172

Adds a unique Nonce with each query. Enabling will prevent queries from being answered with a cached response.

const agent = new HttpAgent({ useQueryNonces: true });
agent.addTransform(makeNonceTransform(makeNonce);
false

optional verifyQuerySignatures: boolean

Defined in: packages/core/src/agent/agent/http/index.ts:186

Whether the agent should verify signatures signed by node keys on query responses. Increases security, but adds overhead and must make a separate request to cache the node keys for the canister’s subnet.

true