@edirect/request
v9.1.2
Published
EDirect Request
Downloads
202
Maintainers
Keywords
Readme
@edirect/request
The EDirectInsure Request.
Installation
$ npm i --save @edirect/request
Usage
const { sendRequest } = require('@edirect/request');
sendRequest('entity-service', {
headers: {
Authorization: `Basic ${token}`
}
}).request(method, uri, data);
or
import * as request from '@edirect/request';
request.sendRequest('entity-service', {
headers: {
Authorization: `Basic ${token}`
}
}).request(method, uri, data);
If the consuming project does not have the common config folder structure, you have the option to set the baseURL in the options object and leave the service name parameter empty (empty string or null), as shown below:
import * as request from '@edirect/request';
request.sendRequest(null, {
baseURL: 'https://auth-service.bolttechbroker.net'
headers: {
Authorization: `Basic ${token}`
}
}).request(method, uri, data);