Options
All
  • Public
  • Public/Protected
  • All
Menu

Module src/core/request/engines/fetch

core/request/engines/fetch

This module provides a function that creates a request engine based on the Fetch API. Mind, this API is developed to work in a browser — node.js support only for tests.

Synopsis

  • The engine is used by default in a browser if it supports AbortController.
  • The engine supports response streaming.

Example

import fetchEngine from 'core/request/engines/fetch';

req('/search', {engine: fetchEngine}).then(({response}) => {
console.log(response.decode());
});

Index

Variables

Variables

default: RequestEngine = ...

Creates request by using the fetch API with the specified parameters and returns a promise

param params