0.1.2 • Published 4 years ago

obten v0.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

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

1.0.0

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago