lib/server/serviceProxy.js
function (svc, attributes, options) {
            options = options || {};
            if (!options.success) {
                throw new Error('Success callback undefined for service call svc: ' + svc);
            }

            var error = options.error;
            options.error = function (err) {
                if (error) {
                    error(err);
                }
            };
            // use the backbone verbs
            return this.sync(
                'update',
                {
                    name: svc,
                    url: svc,
                    params: options.params,
                    ctx: this.ctx,
                    toJSON: function () {
                        return attributes;
                    }
                },
                options);
        }
function (svc, attributes, options) {
            options = options || {};
            if (!options.success) {
                throw new Error('Success callback undefined for service call svc: ' + svc);
            }

            var error = options.error;
            options.error = function (err) {
                if (error) {
                    error(err);
                }
            };
            // use the backbone verbs
            return this.sync(
                'update',
                {
                    name: svc,
                    url: svc,
                    params: options.params,
                    ctx: this.ctx,
                    toJSON: function () {
                        return attributes;
                    }
                },
                options);
        }
function ( svc , attributes , options ) { options = options || { } ; if ( ! options . success ) { throw new Error ( 'Success callback undefined for service call svc: ' + svc ) ; } var error = options . error ; options . error = function ( err ) { if ( error ) { error ( err ) ; } } ; // use the backbone verbs return this . sync ( 'update' , { name : svc , url : svc , params : options . params , ctx : this . ctx , toJSON : function ( ) { return attributes ; } } , options ) ; }
Used to send a PUT request to a service
@method put
@param {String} svc The url for a given service endpoint
@param {Object} attributes A hash containing name-value pairs used to be sent as the payload to the server
@param {Object} options
@param {Object} [options.params] A hash containing name-value pairs used in url substitution.
@param {Function} options.success Callback function to be called when fetch succeeds, passed <code>(response)</code> as argument.
@param {Function} options.error Callback function to be called when fetch fails, passed <code>(response)</code> as argument.
@async
Used to send a PUT request to a service