mirror of
https://github.com/DIYgod/DPlayer
synced 2024-11-22 18:56:54 +00:00
Fix POST Content-type: application/json
some RESTful backend unable to parse
This commit is contained in:
parent
06012e16e0
commit
f72764ab88
@ -24,6 +24,7 @@ const SendXMLHttpRequest = (url, data, success, error, fail) => {
|
||||
};
|
||||
|
||||
xhr.open(data !== null ? 'POST' : 'GET', url, true);
|
||||
xhr.setRequestHeader("Content-type", "application/json; charset=UTF-8");
|
||||
xhr.send(data !== null ? JSON.stringify(data) : null);
|
||||
};
|
||||
|
||||
@ -50,4 +51,4 @@ export default {
|
||||
callback({ status: xhr.status, response: null });
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user