index.js
function (route, parameters) {

        return new Promise((resolve, reject) => {

            request.post({
                url: baseUrl + route,
                qs: parameters
            }, (error, response, body) => {

                if (error) {
                    reject(error);
                } else { resolve('POST sent to ' + baseUrl + route + '\n' + JSON.stringify(parameters)); }
            });
        });
    }
function (route, parameters) {

        return new Promise((resolve, reject) => {

            request.post({
                url: baseUrl + route,
                qs: parameters
            }, (error, response, body) => {

                if (error) {
                    reject(error);
                } else { resolve('POST sent to ' + baseUrl + route + '\n' + JSON.stringify(parameters)); }
            });
        });
    }
function ( route , parameters ) { return new Promise ( ( resolve , reject ) => { request . post ( { url : baseUrl + route , qs : parameters } , ( error , response , body ) => { if ( error ) { reject ( error ) ; } else { resolve ( 'POST sent to ' + baseUrl + route + '\n' + JSON . stringify ( parameters ) ) ; } } ) ; } ) ; }
Send a post request to ESI
Send a post request to ESI