fetcher/http

Description:
  • Fetch proofs using HTTP requests

Source:

Fetch proofs using HTTP requests

Example

import { fetcher } from 'doipjs';
const data = await fetcher.http.fn({ url: 'https://domain.example/data.json', format: 'json' });

Members

(static, constant) timeout :number

Description:
  • Default timeout after which the fetch is aborted

Source:
Default Value:
  • 5000

Default timeout after which the fetch is aborted

Type:
  • number

Methods

(static) fn(data, optsopt) → {Promise.<(object|string)>}

Description:
  • Execute a fetch request

Source:
Parameters:
Name Type Attributes Description
data object

Data used in the request

Properties
Name Type Attributes Description
url string

The URL pointing at targeted content

format string

The format of the targeted content

fetcherTimeout number <optional>

Optional timeout for the fetcher

opts module:types~VerificationConfig <optional>

Options used to enable the request

Returns:

The fetched JSON object or text

Type
Promise.<(object|string)>