Fix ajax json requests should be application/json
This commit is contained in:
@ -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;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user