[ML] Fixing MS Edge GET request error (#18713)
This commit is contained in:
parent
34cc14f445
commit
d77cc5676b
|
@ -27,12 +27,17 @@ export function http(options) {
|
||||||
const allHeaders = (options.headers === undefined) ? headers : { ...options.headers, ...headers };
|
const allHeaders = (options.headers === undefined) ? headers : { ...options.headers, ...headers };
|
||||||
const body = (options.data === undefined) ? null : JSON.stringify(options.data);
|
const body = (options.data === undefined) ? null : JSON.stringify(options.data);
|
||||||
|
|
||||||
fetch(url, {
|
const payload = {
|
||||||
method: (options.method || 'GET'),
|
method: (options.method || 'GET'),
|
||||||
headers: (allHeaders),
|
headers: allHeaders,
|
||||||
credentials: 'same-origin',
|
credentials: 'same-origin'
|
||||||
body,
|
};
|
||||||
})
|
|
||||||
|
if (body !== null) {
|
||||||
|
payload.body = body;
|
||||||
|
}
|
||||||
|
|
||||||
|
fetch(url, payload)
|
||||||
.then((resp) => {
|
.then((resp) => {
|
||||||
resolve(resp.json());
|
resolve(resp.json());
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue