Tag:xmlhttprequest

  • XMLHttpRequest object parsing

    Time:2022-11-12

    <!DOCTYPE html><html><body> <script> function reqListener () { console.log(this); console.log(this.getAllResponseHeaders()); console.log(this.responseText); } var params = “lorem=ipsum&name=binny”; var oReq = new XMLHttpRequest(); oReq.upload.onloadstart = function(){// alert(‘onloadstart’); }; oReq.upload.onprogress = function(){ alert(‘onprogress’); }; oReq.onprogress = function(){ alert(‘download onprogress’); } oReq.onload = reqListener; oReq.onreadystatechange = function(){ alert(this.readyState); } oReq.onerror = function(){ alert(‘error’); } oReq.open(“POST”, “http://localhost:81/DeviceRegisters/ajax”, true); oReq.setRequestHeader(“Content-type”, “application/x-www-form-urlencoded”); oReq.send(params); […]

  • AFNetworking Request XML

    Time:2022-11-9

    Foreword: The http protocol is the most common way for a server to communicate data with a client. In general, the data format is JSON, but there are also cases of XML. JSON format can be parsed, how to parse XML?—— This article is based on AFNetworking 3.2.1 version References: https://stackoverflow.com/que…https://stackoverflow.com/que…focus Generally speaking, when we […]