function(method, isTest, paramsMethod, blob) {
      // Add data from the query options
      var query = evalOpts(this.flowObj.opts.query, this.fileObj, this, isTest);
      query = extend(query || {}, this.getParams());

      var target = evalOpts(this.flowObj.opts.target, this.fileObj, this, isTest);
      var data = null;
      if (method === 'GET' || paramsMethod === 'octet') {
        // Add data from the query options
        var params = [];
        each(query, function (v, k) {
          params.push([encodeURIComponent(k), encodeURIComponent(v)].join('='));
        });
        target = this.getTarget(target, params);
        data = blob || null;
      } else {
        // Add data from the query options
        data = new FormData();
        each(query, function (v, k) {
          data.append(k, v);
        });
        if (typeof blob !== "undefined") data.append(this.flowObj.opts.fileParameterName, blob, this.fileObj.file.name);
      }

      this.xhr.open(method, target, true);
      this.xhr.withCredentials = this.flowObj.opts.withCredentials;

      // Add data from header options
      each(evalOpts(this.flowObj.opts.headers, this.fileObj, this, isTest), function (v, k) {
        this.xhr.setRequestHeader(k, v);
      }, this);

      return data;
    }
function(method, isTest, paramsMethod, blob) {
      // Add data from the query options
      var query = evalOpts(this.flowObj.opts.query, this.fileObj, this, isTest);
      query = extend(query || {}, this.getParams());

      var target = evalOpts(this.flowObj.opts.target, this.fileObj, this, isTest);
      var data = null;
      if (method === 'GET' || paramsMethod === 'octet') {
        // Add data from the query options
        var params = [];
        each(query, function (v, k) {
          params.push([encodeURIComponent(k), encodeURIComponent(v)].join('='));
        });
        target = this.getTarget(target, params);
        data = blob || null;
      } else {
        // Add data from the query options
        data = new FormData();
        each(query, function (v, k) {
          data.append(k, v);
        });
        if (typeof blob !== "undefined") data.append(this.flowObj.opts.fileParameterName, blob, this.fileObj.file.name);
      }

      this.xhr.open(method, target, true);
      this.xhr.withCredentials = this.flowObj.opts.withCredentials;

      // Add data from header options
      each(evalOpts(this.flowObj.opts.headers, this.fileObj, this, isTest), function (v, k) {
        this.xhr.setRequestHeader(k, v);
      }, this);

      return data;
    }
function ( method , isTest , paramsMethod , blob ) { // Add data from the query options var query = evalOpts ( this . flowObj . opts . query , this . fileObj , this , isTest ) ; query = extend ( query || { } , this . getParams ( ) ) ; var target = evalOpts ( this . flowObj . opts . target , this . fileObj , this , isTest ) ; var data = null ; if ( method === 'GET' || paramsMethod === 'octet' ) { // Add data from the query options var params = [ ] ; each ( query , function ( v , k ) { params . push ( [ encodeURIComponent ( k ) , encodeURIComponent ( v ) ] . join ( '=' ) ) ; } ) ; target = this . getTarget ( target , params ) ; data = blob || null ; } else { // Add data from the query options data = new FormData ( ) ; each ( query , function ( v , k ) { data . append ( k , v ) ; } ) ; if ( typeof blob !== "undefined" ) data . append ( this . flowObj . opts . fileParameterName , blob , this . fileObj . file . name ) ; } this . xhr . open ( method , target , true ) ; this . xhr . withCredentials = this . flowObj . opts . withCredentials ; // Add data from header options each ( evalOpts ( this . flowObj . opts . headers , this . fileObj , this , isTest ) , function ( v , k ) { this . xhr . setRequestHeader ( k , v ) ; } , this ) ; return data ; }
Prepare Xhr request. Set query, headers and data
@param {string} method GET or POST
@param {bool} isTest is this a test request
@param {string} [paramsMethod] octet or form
@param {Blob} [blob] to send
@returns {FormData|Blob|Null} data to send
Prepare Xhr request . Set query headers and data