Merge pull request #204 from a-wing/patch-1

Fix POST Content-type: application/json
This commit is contained in:
DIYgod 2018-02-22 12:13:28 +08:00 committed by GitHub
commit ee618f7d20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 });
});
}
};
};