Javascript 客户端服务器的byteArray响应未完成
后端服务发送byteArray,长度超过4万条记录,但下面代码中的“responseArray”显示13条记录。如何在客户端获取所有记录Javascript 客户端服务器的byteArray响应未完成,javascript,Javascript,后端服务发送byteArray,长度超过4万条记录,但下面代码中的“responseArray”显示13条记录。如何在客户端获取所有记录 xhr.onreadystatechange = function () { if (this.readyState == 4 && this.status == 200) { var responseArray = new Uint8Array(t
xhr.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
var responseArray = new Uint8Array(this.response);
}
}
xhr.open('POST', '/Docs/GetByteArray');
xhr.responseType = 'arraybuffer';
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.send("docId="+docId+"&docName="+docInfo.Name+"&documentType="+docInfo.DocumentType+"&options="+optionsXmlStr );
服务方法
公共字节[]GetByteArray(POC.Controllers.Request docData)
{var response=cService.process(请求);byte[]docBytes=new byte[0];if(response.Payload!=null)docBytes=response.Payload.Document;返回docBytes
}服务器端代码是什么样子的?网络流量是什么样子的?HTTP响应是否包含多个千字节的数据?即使服务发送5条记录,它在XHR响应中也会显示13条记录。字节[]docBytes=新字节[]{1,2,3,4,5};返回docBytes;