code: function trim() {
    var s = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0];
  
    return ''.trim ? s.trim(s) : s.replace(/(^\s*|\s*$)/g, '');
  }
docs: value should have the following format
  {
  body: {
  responseType: '',
  responseText: value,
  status: '',
  statusText: ''
  },
  headers: ''
  }
   borrow from superagent