Fix ajax json requests should be application/json
parent
5bd52b0423
commit
0316c31708
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue