obten

0.1.2 • Public • Published

obten

A fetch based minimal HTTP client for JavaScript Applications running in the web browser.

Usage

Install obten in your node application

  npm install --save obten

import obten

import obten from 'obten';
obten uses a configuration object for any of it's methods. See below how to use it in your applications.
  1. Making a GET request:
obten
    .get({
        url: '',
    })
    .then((data) => console.log(data));

note: url is a required parameter.

  1. Making a POST request
obten
    .post({
        url: '',
        body: {},
    })
    .then((data) => console.log(data));

note: url and body are the required parameters.

  1. Making a PUT request:
obten
    .put({
        url: '',
        body: {},
    })
    .then((data) => console.log(data));

note: url and body are the required parameters.

  1. Making a DELETE request
obten
    .delete({
        url: '',
    })
    .then((data) => console.log(data));

note: url is a required parameter.

You can optionally pass a headers object with your headers in the standard format

obten.method({
    headers: {
        'header-name': 'value',
    },
});

note: method can be any of the one mentioned above.

LICENSE

MIT

Readme

Keywords

Package Sidebar

Install

npm i obten

Weekly Downloads

2

Version

0.1.2

License

MIT

Unpacked Size

6.54 kB

Total Files

7

Last publish

Collaborators

  • vyasriday