src/extensions/default/HealthData/HealthDataManager.js
function sendAnalyticsDataToServer(eventParams) {
        var result = new $.Deferred();

        var analyticsData = getAnalyticsData(eventParams);
        $.ajax({
            url: brackets.config.analyticsDataServerURL,
            type: "POST",
            data: JSON.stringify({events: [analyticsData]}),
            headers: {
                "Content-Type": "application/json",
                "x-api-key": brackets.config.serviceKey
            }
        })
            .done(function () {
                result.resolve();
            })
            .fail(function (jqXHR, status, errorThrown) {
                console.error("Error in sending Adobe Analytics Data. Response : " + jqXHR.responseText + ". Status : " + status + ". Error : " + errorThrown);
                result.reject();
            });

        return result.promise();
    }
function sendAnalyticsDataToServer(eventParams) {
        var result = new $.Deferred();

        var analyticsData = getAnalyticsData(eventParams);
        $.ajax({
            url: brackets.config.analyticsDataServerURL,
            type: "POST",
            data: JSON.stringify({events: [analyticsData]}),
            headers: {
                "Content-Type": "application/json",
                "x-api-key": brackets.config.serviceKey
            }
        })
            .done(function () {
                result.resolve();
            })
            .fail(function (jqXHR, status, errorThrown) {
                console.error("Error in sending Adobe Analytics Data. Response : " + jqXHR.responseText + ". Status : " + status + ". Error : " + errorThrown);
                result.reject();
            });

        return result.promise();
    }
function sendAnalyticsDataToServer ( eventParams ) { var result = new $ . Deferred ( ) ; var analyticsData = getAnalyticsData ( eventParams ) ; $ . ajax ( { url : brackets . config . analyticsDataServerURL , type : "POST" , data : JSON . stringify ( { events : [ analyticsData ] } ) , headers : { "Content-Type" : "application/json" , "x-api-key" : brackets . config . serviceKey } } ) . done ( function ( ) { result . resolve ( ) ; } ) . fail ( function ( jqXHR , status , errorThrown ) { console . error ( "Error in sending Adobe Analytics Data. Response : " + jqXHR . responseText + ". Status : " + status + ". Error : " + errorThrown ) ; result . reject ( ) ; } ) ; return result . promise ( ) ; }
Send Analytics data to Server
Send Analytics data to Server