1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| var data = { password: "xxx", userName: "xxx" }; var xhr = new XMLHttpRequest(); xhr.open('post', 'http://127.0.0.1:8080/console/login'); xhr.setRequestHeader("Content-type","application/json"); xhr.setRequestHeader("SESSION_TOKEN","112233"); xhr.setRequestHeader("CONSOLE_SESSION_TOKEN","112233");
xhr.send(JSON.stringify(data)); xhr.onload = function(e) { var xhr = e.target; console.log(xhr.responseText); }
|