code: function xhrClient (request) {
      return new PromiseObj(function (resolve) {
  
          var xhr = new XMLHttpRequest(), handler = function (event) {
  
                  var response = request.respondWith(
                  'response' in xhr ? xhr.response : xhr.responseText, {
                      status: xhr.status === 1223 ? 204 : xhr.status, // IE9 status bug
                      statusText: xhr.status === 1223 ? 'No Content' : trim(xhr.statusText)
                  });
  
                  each(trim(xhr.getAllResponseHeaders()).split('\n'), function (row) {
                      response.headers.append(row.slice(0, row.indexOf(':')), row.slice(row.indexOf(':') + 1));
                  });
  
                  resolve(response);
              };
  
          request.abort = function () { return xhr.abort(); };
  
          xhr.open(request.method, request.getUrl(), true);
  
          if (request.timeout) {
              xhr.timeout = request.timeout;
          }
  
          if (request.responseType && 'responseType' in xhr) {
              xhr.responseType = request.responseType;
          }
  
          if (request.withCredentials || request.credentials) {
              xhr.withCredentials = true;
          }
  
          if (!request.crossOrigin) {
              request.headers.set('X-Requested-With', 'XMLHttpRequest');
          }
  
          // deprecated use downloadProgress
          if (isFunction(request.progress) && request.method === 'GET') {
              xhr.addEventListener('progress', request.progress);
          }
  
          if (isFunction(request.downloadProgress)) {
              xhr.addEventListener('progress', request.downloadProgress);
          }
  
          // deprecated use uploadProgress
          if (isFunction(request.progress) && /^(POST|PUT)$/i.test(request.method)) {
              xhr.upload.addEventListener('progress', request.progress);
          }
  
          if (isFunction(request.uploadProgress) && xhr.upload) {
              xhr.upload.addEventListener('progress', request.uploadProgress);
          }
  
          request.headers.forEach(function (value, name) {
              xhr.setRequestHeader(name, value);
          });
  
          xhr.onload = handler;
          xhr.onabort = handler;
          xhr.onerror = handler;
          xhr.ontimeout = handler;
          xhr.send(request.getBody());
      });
  }
docs: XMLHttp client (Browser).