Ionic https //127.0.0.1:111001意外关闭了连接

gkl3eglg  于 2023-08-01  发布在  Ionic
关注(0)|答案(1)|浏览(189)

https//127.0.0.1:111001意外关闭连接
我需要点击https//127.0.0.1:111001为曼特拉路服务连接。但无法击中获取错误连接关闭(我使用IONIC的移动的应用程序)同样的事情是工作在web上与angular 8。
请帮帮我

wbgh16ku

wbgh16ku1#

const xhr = new XMLHttpRequest();

let url = "https://127.0.0.1:11100"

xhr.open('DEVICEINFO', url);

const params = '<?xml version="1.0"?> <PidOptions ver="1.0"> <Opts fCount="' + 5 + '" fType="' + "FMR" + '" iCount="' + 1 + '" pCount="' + 1 + '" format="' + 0 + '"   pidVer="' + 2.0 + '" timeout="' + 60000 + '" posh="UNKNOWN" env="' + 'P' + '" /> ' + 'this.DemoFinalString' + '<CustOpts><Param name="mantrakey" value="' + '' + '" /></CustOpts> </PidOptions>';
// set `Content-Type` header
xhr.setRequestHeader('Content-Type', 'text/xml');

xhr.send(params);


xhr.onload = async () => {
  const parser = new DOMParser();
  const xml = parser.parseFromString(xhr.responseText, 'text/xml');
  this.obj = await this.xmlToJsonfn(xml);
  this.currentdeviceInfoSubject.next(this.obj);
};

xhr.onerror = function (e) {
  console.log('eoor', e);
  if (e.type == 'error') {
    // alert('please download the Driver');
  
  }
};

字符串

相关问题