ohif-viewer/Packages/dicomweb/server/getJSON.js
weiwei 2cf666f7a5 Revert "Merge branch 'master' of github.com:OHIF/Viewers"
This reverts commit 137007c220, reversing
changes made to af639b4de2.
2016-10-24 22:17:22 +08:00

32 lines
547 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;
};