Chrome 控制台模拟POST

var url = "http://*****/app/invited/invited/personlist";
var params = {phone: "",orderkey: "time",ordermethod: "desc",page: 0,pagesize:60};
var xhr = new XMLHttpRequest();
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.onload = function (e) {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
console.log(xhr.responseText);
} else {
console.error(xhr.statusText);
}
}
};
xhr.onerror = function (e) {
console.error(xhr.statusText);
};
xhr.send(JSON.stringify(params));
原文地址:https://www.cnblogs.com/wxbug/p/14069716.html