lib/events.js
function(payload){
    if (!Array.isArray(payload)) payload = [payload];
    var options = {
      // events must be sent with POST
      method: "POST",
      host: this.origin,
      path: this.endpoint +  "?access_token=" + this.access_token,
      headers: {
        'Content-Type': 'application/json'
      },
      body:JSON.stringify(payload) //events are arrays
    }
    return options
  }
function(payload){
    if (!Array.isArray(payload)) payload = [payload];
    var options = {
      // events must be sent with POST
      method: "POST",
      host: this.origin,
      path: this.endpoint +  "?access_token=" + this.access_token,
      headers: {
        'Content-Type': 'application/json'
      },
      body:JSON.stringify(payload) //events are arrays
    }
    return options
  }
function ( payload ) { if ( ! Array . isArray ( payload ) ) payload = [ payload ] ; var options = { // events must be sent with POST method : "POST" , host : this . origin , path : this . endpoint + "?access_token=" + this . access_token , headers : { 'Content-Type' : 'application/json' } , body : JSON . stringify ( payload ) //events are arrays } return options }
Get http request options
@private
@param {*} payload
Get http request options