Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

bm-minimal-fetch

ferudinato13MIT1.1.0TypeScript support: included

An http fetcher with basic options to make it simpler

http, request, get, post, fetch, fetcher, frontend, minimal, simple, basic, easy, http request, http get, http post, http fetch

readme

http-minimal-fetch

An http fetcher with basic options to make it simpler

Usage

This package is instanced using a singleton pattern, so you only need to import it like this way:

import HttpRequest from 'bm-minimal-fetch';
const http = HttpRequest.getInstance('http://your-desired-url-to-fetch');

Now if you need to do an HTTP GET request, just type:

http.get('/your-endpoint');

Also, we would be able to send an HTTP POST request, just typing:

http.post('/your-endpoint', {
  user: 'foo',
  lastname: 'bar'
})