来自服务器的byteArray响应在客户端

时间:2017-05-25 13:10:17

标签: javascript

后端服务发送byteArray,其长度超过4万条记录,然而," responseArray"在下面的代码中显示了13条记录。如何在客户端获取所有记录?

    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 );

服务方法......

public byte [] GetByteArray(POC.Controllers.Request docData) {var response = cService.process(request); byte [] docBytes = new byte [0]; if(response.Payload!= null)docBytes = response.Payload.Document;返回docBytes }

0 个答案:

没有答案