Skip to content

Cookbook: fetch

Eugene Lazutkin edited this page Nov 26, 2019 · 3 revisions

In order to use io.fetch make sure that it is enabled:

// activate the package
io.fetch.attach();

// deactivate the package
io.fetch.detach();

See How to include for more details. See fetch for the full documentation.

Set fetch defaults

io.get({
  url: '/url',
  fetchMode: 'no-cors',
  fetchCredentials: 'omit',
  fetchReferrerPolicy: ''
}).then(function (value) {
  console.log('Got:', value);
});
Clone this wiki locally