Skip to main content

Type Alias: IHttpTransportConfig

type IHttpTransportConfig: object;

The interface representing the configuration of the HTTP transport.

Type declaration

endpoint

endpoint: string;

The network endpoint. It is set to the URL of the network node.

Example

'http://127.0.0.1:8529'

fetcher?

optional fetcher: typeof fetch;

The fetch function to be used for making requests. This is useful for testing purposes and leveraging signals/etc.

Example

import fetch from 'isomorphic-fetch';

Default

fetch

headers?

optional headers: Record<string, string>;

The headers to be sent with the request.

Example

{ 'My-header': 'my-value' }

Default

{}

timeout?

optional timeout: number;

The request timeout. If the request is not completed within the timeout, it will be rejected.

Example

1000

Default

20000

Defined

@nilfoundation/niljs/src/transport/types/IHttpTransportConfig.ts:4