smoothly-request
v1.1.4
Published
Perform request with promise based client on NodeJS
Downloads
123
Maintainers
Readme
Smoothly request
Perform request with promise based client on NodeJS
Smoothly request enables developer to send request with promise based client on NodeJS. The package generally was designed for cloud functions (aws lambda, google functions etc.), and it has a little unpacked size.
Installing
Using npm:
$ npm install smoothly-request
Example
Performing a GET
request
const smoothlyRequest = require('smoothly-request');
(async () => {
const result = await smoothlyRequest({
hostname: `https://ahmetonursolmaz.com.tr`,
path: '/users/2',
method: 'GET'
});
})();
Performing a POST
request
const smoothlyRequest = require('smoothly-request');
(async () => {
const result = await smoothlyRequest({
hostname: `https://ahmetonursolmaz.com.tr`,
path: '/users',
method: 'POST',
payload: {},
});
})();
Performing an another
request
const smoothlyRequest = require('smoothly-request');
(async () => {
const result = await smoothlyRequest({
hostname: `https://ahmetonursolmaz.com.tr`,
path: '/users/2',
method: 'PATCH',
payload: {},
});
})();
(async () => {
const result = await smoothlyRequest({
hostname: `https://ahmetonursolmaz.com.tr`,
path: '/users/2',
method: 'DELETE',
payload: {},
});
})();