Fix ajax json requests should be application/json

This commit is contained in:
Berkeley Martinez
2016-01-09 19:59:17 -08:00
parent 850c63a0a0
commit 7e2867f747

View File

@ -272,7 +272,10 @@ export function postJSON$(url, body) {
body, body,
method: 'POST', method: 'POST',
responseType: 'json', 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 * @returns {Observable} The observable sequence which contains the parsed JSON
*/ */
export function getJSON$(url) { 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; return x.response;
}); });
} }