Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Modified the post, put, head and del shortcuts to support uri optional param #180

merged 1 commit into from

2 participants


Now you should be able to do the following:"", function(e,r,b) { console.log(b) });
//or"", { body: 'foo=bar'}, function(e,r,b) { console.log(b) });
//and still do{ uri: "", body: 'foo=bar'}, function(e,r,b) { console.log(b) });

created a new function called initParams to reduce duplication:

function initParams(uri, options, callback) {
  if ((typeof options === 'function') && !callback) callback = options;
  if (typeof options === 'object') {
    options.uri = uri;
  } else if (typeof uri === 'string') {
    options = {uri:uri};
  } else {
    options = uri;
    uri = options.uri;
  return { uri: uri, options: options, callback: callback };

and each shortcut method calls this method to organize the method params = function (uri, options, callback) {
  var params = initParams(uri, options, callback);
  params.options.method = 'POST';
  return request(params.uri, params.options, params.callback)
@mikeal mikeal merged commit 56d868d into from
@cybdoom cybdoom referenced this pull request from a commit in cybdoom/EbayAmazonApiServer
@cybdoom cybdoom