https//127.0.0.1:111001意外关闭连接我需要点击https//127.0.0.1:111001为曼特拉路服务连接。但无法击中获取错误连接关闭(我使用IONIC的移动的应用程序)同样的事情是工作在web上与angular 8。请帮帮我
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'); } };
字符串
1条答案
按热度按时间wbgh16ku1#
const xhr = new XMLHttpRequest();
字符串