admin管理员组

文章数量:1530016

首先window+R调出运行,输入
chrome.exe --user-data-dir="C://Chrome dev session" --disable-web-security
这一步目的是关掉chrome的CORS策略。

在弹出的chrome中F12调出控制台,console中输入如下代码后回车。

var url = "http://localhost:8080/xxx/ipt/record/getRecordStream";
var params = {callId:"00745436566908409080",type:"voip"};
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));

本文标签: 接口浏览器chromepost