How to send POST request in JavaScript?
Posted on In QAHow to send POST request in JavaScript from the users’ browsers?
One easy method I find is to use the jQuery library’s post()
method.
Here is one example that send POST request with data “file: filename” to the “/fileview” URL on the server and show the replied data:
$.post("/fileview", {file: filename}, function (data) {
// actions upon receiving the reply
alert("Data received: " + data);
});
More details, please check manual of jQuery.post() manual: http://api.jquery.com/jquery.post/