ajax-for-node
v1.0.12
Published
Implementing Ajax request of jQuery with node.
Downloads
13
Readme
🚀 nodeajax
Implementing Ajax request of jQuery with node without cross-domain.
Install
$ npm install ajax-for-node
Usage
const nodeAjax = require('ajax-for-node');
var formData = new FormData();
formData.append("username", "Groucho");
formData.append("accountnum", 123456);
nodeAjax({
url: "https://echo.apipost.cn/get.php",
data: formData,
type: "POST",
processData: false,
contentType: false,
success: function (data, status, xhr) {
console.log(data, status, xhr)
},
error: function (xhr, status, error) {
console.log(xhr, status, error)
},
complete: function (xhr, status) {
console.log(xhr, status)
}
});