ohif-viewer/Packages/dicomweb/server/getJSON.js
2016-01-11 11:32:20 +01:00

32 lines
540 B
JavaScript

DICOMWeb.getJSON = function(url, options) {
var getOptions = {
headers: {
Accept: 'application/json'
},
};
if (options.auth) {
getOptions.auth = options.auth;
}
if (options.logRequests) {
console.log(url);
}
if (options.logTiming) {
console.time(url);
}
var result = HTTP.get(url, getOptions);
if (options.logTiming) {
console.timeEnd(url);
}
if (options.logResponses) {
console.log(result.data);
}
return result;
};