js/cloudmine.js
function(snippet, parameters, options) {
      options = opts(this, options);
      parameters = merge({}, options.params, parameters);
      options.params = null;
      options.snippet = null;

      var call_opts = {
        action: 'run/' + snippet,
        type: options.method || 'GET',
        options: options
      };

      if(call_opts.type === 'GET')
        call_opts.query = parameters;
      else {
        call_opts.data = JSON.stringify(parameters);
      }

      return new APICall(call_opts);
    }
function(snippet, parameters, options) {
      options = opts(this, options);
      parameters = merge({}, options.params, parameters);
      options.params = null;
      options.snippet = null;

      var call_opts = {
        action: 'run/' + snippet,
        type: options.method || 'GET',
        options: options
      };

      if(call_opts.type === 'GET')
        call_opts.query = parameters;
      else {
        call_opts.data = JSON.stringify(parameters);
      }

      return new APICall(call_opts);
    }
function ( snippet , parameters , options ) { options = opts ( this , options ) ; parameters = merge ( { } , options . params , parameters ) ; options . params = null ; options . snippet = null ; var call_opts = { action : 'run/' + snippet , type : options . method || 'GET' , options : options } ; if ( call_opts . type === 'GET' ) call_opts . query = parameters ; else { call_opts . data = JSON . stringify ( parameters ) ; } return new APICall ( call_opts ) ; }
Run a code snippet directly.
Default http method is 'GET', to change the method set the method option for options.
@param {string} snippet The name of the code snippet to run.
@param {object} params Data to send to the code snippet (optional).
@param {object} [options] Override defaults set on WebService. See WebService constructor for parameters.
@return {APICall} An APICall instance for the web service request used to attach events.
Run a code snippet directly . Default http method is GET to change the method set the method option for options .