Browse Source

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

Fix POST Content-type: application/json
DIYgod 7 years ago
parent
commit
ee618f7d20
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/js/api.js

+ 2 - 1
src/js/api.js

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