inst/www/bower_components/opencpu/opencpu-0.3.js
//Automatically determines type based on argument classes.
Automatically determines type based on argument classes.
Automatically determines type based on argument classes .
function r_fun_call(fun, args, handler){
    var hasfiles = false;
    var hascode = false;
    var args = args || {};
    $.each(args, function(key, value){
      if(value instanceof File || value instanceof Upload || value instanceof FileList){
        hasfiles = true;
      } else if (value instanceof Snippet || value instanceof Session){
        hascode = true;
      }
    });
    if(hasfiles){
      return r_fun_call_multipart(fun, args, handler);
    } else if(hascode || r_cors){
      return r_fun_call_urlencoded(fun, args, handler);
    } else {
      return r_fun_call_json(fun, args, handler); 
    }
  }
function r_fun_call ( fun , args , handler ) { var hasfiles = false ; var hascode = false ; var args = args || { } ; $ . each ( args , function ( key , value ) { if ( value instanceof File || value instanceof Upload || value instanceof FileList ) { hasfiles = true ; } else if ( value instanceof Snippet || value instanceof Session ) { hascode = true ; } } ) ; if ( hasfiles ) { return r_fun_call_multipart ( fun , args , handler ) ; } else if ( hascode || r_cors ) { return r_fun_call_urlencoded ( fun , args , handler ) ; } else { return r_fun_call_json ( fun , args , handler ) ; } }
Automatically determines type based on argument classes.
Automatically determines type based on argument classes .
//find argument types //determine type //note: cors with application/json requires preflighting, which is supported but annoying.