silas / node-papi

Library for building HTTP API clients
MIT License
26 stars 8 forks source link

marathon.register does not allow specfying headers #6

Closed memelet closed 6 years ago

memelet commented 8 years ago

It seems that marathon requires content-type json even though no data is being posted. But register eats all the papi opts (eg, type)

EventSubscription.prototype.register = function(opts, callback) {
  if (typeof opts === 'string') {
    opts = { url: opts };
  }

  var req = {
    name: 'eventSubscription.register',
    path: '/eventSubscriptions',
    query: { callbackUrl: opts.url },
  };

  if (!opts.url) return callback(this.marathon._err('url required', req));

  this.marathon._post(req, utils.empty, callback);
};
silas commented 6 years ago

I stopped supporting the mesos package a while back and it's not something I can fix here. Sorry for never getting back to you (I never really used the package and it also immediately languished).