build/tincan.js
function (cfg) {
            this.log("sendRequest");
            var fullUrl = this.endpoint + cfg.url,
                headers = {},
                prop
            ;

            // respect absolute URLs passed in
            if (cfg.url.indexOf("http") === 0) {
                fullUrl = cfg.url;
            }

            // add extended LMS-specified values to the params
            if (this.extended !== null) {
                cfg.params = cfg.params || {};

                for (prop in this.extended) {
                    if (this.extended.hasOwnProperty(prop)) {
                        // don't overwrite cfg.params values that have already been added to the request with our extended params
                        if (! cfg.params.hasOwnProperty(prop)) {
                            if (this.extended[prop] !== null) {
                                cfg.params[prop] = this.extended[prop];
                            }
                        }
                    }
                }
            }

            // consolidate headers
            headers.Authorization = this.auth;
            if (this.version !== "0.9") {
                headers["X-Experience-API-Version"] = this.version;
            }

            for (prop in cfg.headers) {
                if (cfg.headers.hasOwnProperty(prop)) {
                    headers[prop] = cfg.headers[prop];
                }
            }

            return this._makeRequest(fullUrl, headers, cfg);
        }
function (cfg) {
            this.log("sendRequest");
            var fullUrl = this.endpoint + cfg.url,
                headers = {},
                prop
            ;

            // respect absolute URLs passed in
            if (cfg.url.indexOf("http") === 0) {
                fullUrl = cfg.url;
            }

            // add extended LMS-specified values to the params
            if (this.extended !== null) {
                cfg.params = cfg.params || {};

                for (prop in this.extended) {
                    if (this.extended.hasOwnProperty(prop)) {
                        // don't overwrite cfg.params values that have already been added to the request with our extended params
                        if (! cfg.params.hasOwnProperty(prop)) {
                            if (this.extended[prop] !== null) {
                                cfg.params[prop] = this.extended[prop];
                            }
                        }
                    }
                }
            }

            // consolidate headers
            headers.Authorization = this.auth;
            if (this.version !== "0.9") {
                headers["X-Experience-API-Version"] = this.version;
            }

            for (prop in cfg.headers) {
                if (cfg.headers.hasOwnProperty(prop)) {
                    headers[prop] = cfg.headers[prop];
                }
            }

            return this._makeRequest(fullUrl, headers, cfg);
        }
function ( cfg ) { this . log ( "sendRequest" ) ; var fullUrl = this . endpoint + cfg . url , headers = { } , prop ; // respect absolute URLs passed in if ( cfg . url . indexOf ( "http" ) === 0 ) { fullUrl = cfg . url ; } // add extended LMS-specified values to the params if ( this . extended !== null ) { cfg . params = cfg . params || { } ; for ( prop in this . extended ) { if ( this . extended . hasOwnProperty ( prop ) ) { // don't overwrite cfg.params values that have already been added to the request with our extended params if ( ! cfg . params . hasOwnProperty ( prop ) ) { if ( this . extended [ prop ] !== null ) { cfg . params [ prop ] = this . extended [ prop ] ; } } } } } // consolidate headers headers . Authorization = this . auth ; if ( this . version !== "0.9" ) { headers [ "X-Experience-API-Version" ] = this . version ; } for ( prop in cfg . headers ) { if ( cfg . headers . hasOwnProperty ( prop ) ) { headers [ prop ] = cfg . headers [ prop ] ; } } return this . _makeRequest ( fullUrl , headers , cfg ) ; }
Method used to send a request via browser objects to the LRS

@method sendRequest
@param {Object} cfg Configuration for request
@param {String} cfg.url URL portion to add to endpoint
@param {String} [cfg.method] GET, PUT, POST, etc.
@param {Object} [cfg.params] Parameters to set on the querystring
@param {String|ArrayBuffer} [cfg.data] Body content as a String or ArrayBuffer
@param {Object} [cfg.headers] Additional headers to set in the request
@param {Function} [cfg.callback] Function to run at completion
@param {String|Null} cfg.callback.err If an error occurred, this parameter will contain the HTTP status code.
If the operation succeeded, err will be null.
@param {Object} cfg.callback.xhr XHR object
@param {Boolean} [cfg.ignore404] Whether 404 status codes should be considered an error
@param {Boolean} [cfg.expectMultipart] Whether to expect the response to be a multipart response
@return {Object} XHR if called in a synchronous way (in other words no callback)
Method used to send a request via browser objects to the LRS