diff --git a/common/utils/ajax-stream.js b/common/utils/ajax-stream.js index ba7b428b2a0..0e02ba8ad35 100644 --- a/common/utils/ajax-stream.js +++ b/common/utils/ajax-stream.js @@ -272,7 +272,10 @@ export function postJSON$(url, body) { body, method: 'POST', responseType: 'json', - headers: { 'Content-Type': 'application/json' } + headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + } }); } @@ -294,7 +297,14 @@ export function get$(url) { * @returns {Observable} The observable sequence which contains the parsed JSON */ export function getJSON$(url) { - return ajax$({ url: url, responseType: 'json' }).map(function(x) { + return ajax$({ + url: url, + responseType: 'json', + headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + } + }).map(function(x) { return x.response; }); }