chrome, 按F12,打开控制台, 执行下面脚本

var url = "https://www.test.com/Admin/testpost;
var params = {id:"1",name:"q"};
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));

相关文章:

  • 2022-01-13
  • 2021-08-09
  • 2021-11-23
  • 2021-11-11
  • 2021-09-28
  • 2021-11-02
猜你喜欢
  • 2022-12-23
  • 2021-05-16
  • 2021-06-13
  • 2022-12-23
  • 2021-11-23
  • 2021-04-24
  • 2021-03-26
相关资源
相似解决方案