lib/odp.js
function _sendRequest (options) {
  return new Promise((resolve, reject) => {
    var query = querystring.stringify(options.query)
    var bodyData = JSON.stringify(options.body)

    request({
      url: _baseUrl + `/${options.endpoint}?${query}`,
      headers: headers,
      method: options.method,
      body: bodyData
    }, (error, response, body) => {
      if (error) {
        reject(error)
      }
      resolve(body)
    })
  })
}
function _sendRequest (options) {
  return new Promise((resolve, reject) => {
    var query = querystring.stringify(options.query)
    var bodyData = JSON.stringify(options.body)

    request({
      url: _baseUrl + `/${options.endpoint}?${query}`,
      headers: headers,
      method: options.method,
      body: bodyData
    }, (error, response, body) => {
      if (error) {
        reject(error)
      }
      resolve(body)
    })
  })
}
function _sendRequest ( options ) { return new Promise ( ( resolve , reject ) => { var query = querystring . stringify ( options . query ) var bodyData = JSON . stringify ( options . body ) request ( { url : _baseUrl + ` ${ options . endpoint } ${ query } ` , headers : headers , method : options . method , body : bodyData } , ( error , response , body ) => { if ( error ) { reject ( error ) } resolve ( body ) } ) } ) }
Calls the service and return the data in a promise, but with POST.
@function
@private
@name _sendRequest
@param {object} options - The request set of options.
@param {string} options.endpoint - Resource endpoint, without any slashes.
@param {object} options.query - The query parameters for the request.
@param {object} options.body - The body if POST, PUT
@param {string} options.method - The method to be used.
@returns {Promise} The response in a promise.
Calls the service and return the data in a promise but with POST .