code: function onResponse(httpCode, headers, body, callback) {
    var resp = {
      _HTTP: {
        status: httpCode
      },
      headers: headers
    };
    var i;
    var pieces;
  
    if(typeof body === 'string') {
      try {
        //JSON decode
        resp.body = (body.length > 0 && decodeJSON) ? JSON.parse(body) : body;
      }
      catch(e) {
        //failed to decode - likely not JSON
        resp.body = body;
      }
    }
  
    //will likely only happen in node due to httpOnly cookies
    if(headers['set-cookie']) {
      resp.cookies = {};
  
      for(i in headers['set-cookie']) {
        if(headers['set-cookie'].hasOwnProperty(i)) {
          pieces = headers['set-cookie'][i].split(';')[0].split('=');
          resp.cookies[pieces[0]] = pieces[1];
          pieces = null;
        }
      }
    }
  
    if(resp._HTTP.status >= 400) {
      observers._notify('error', resp);
    }
  
    if(typeof callback === 'function') {
      callback(resp, (resp._HTTP.status < 400));
    }
  }
docs: Common interface for XHR and http[s] modules to send responses to.