@clifford Вы можете использовать XMLHttpRequest объект в JavaScript чтобы отправить POST запрос на сервер, ниже пример кода:
1 2 3 4 5 6 7 8 9 10 11 |
var xhr = new XMLHttpRequest(); xhr.open("POST", "/to/url", true); xhr.setRequestHeader('Content-Type', 'application/json'); xhr.send(JSON.stringify({ username: 'admin', password: 'test' })); xhr.onload = function () { console.log(this.responseText); } |