Я хочу записать сетевой запрос браузера в таблицу зависимостей appinsight. Ниже приведен код, который работает нормально, но мне нужно также регистрировать код состояния сетевого запроса. Я обнаружил, что getEntriesByType () не дает мне код состояния. Так есть ли способ получить его?
var networkEntries = window.performance.getEntriesByType('resource');
$.each(networkEntries, function(i, item) {
if (appInsights) {
appInsights.queue.push(function() {
appInsights.context.addTelemetryInitializer(function(envelope) {
var telemetryItem = envelope.data.baseData;
telemetryItem.type = telemetryItem.properties.initiatorType;
telemetryItem.id = Microsoft.ApplicationInsights.Util.newId();
});
});
appInsights.trackDependency("id" + i, "", item.name, null, item.responseEnd, true, null, item, null);
};
});