mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[ML] Fixing MS Edge GET request error (#18713)
This commit is contained in:
parent
34cc14f445
commit
d77cc5676b
1 changed files with 10 additions and 5 deletions
|
@ -27,12 +27,17 @@ export function http(options) {
|
|||
const allHeaders = (options.headers === undefined) ? headers : { ...options.headers, ...headers };
|
||||
const body = (options.data === undefined) ? null : JSON.stringify(options.data);
|
||||
|
||||
fetch(url, {
|
||||
const payload = {
|
||||
method: (options.method || 'GET'),
|
||||
headers: (allHeaders),
|
||||
credentials: 'same-origin',
|
||||
body,
|
||||
})
|
||||
headers: allHeaders,
|
||||
credentials: 'same-origin'
|
||||
};
|
||||
|
||||
if (body !== null) {
|
||||
payload.body = body;
|
||||
}
|
||||
|
||||
fetch(url, payload)
|
||||
.then((resp) => {
|
||||
resolve(resp.json());
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue