Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Parse chunked data at Server Code

Hello,

I need to parse chunked data from a external service response at the Server Code.

Found that, I need to use the below sort of code:
var URL = "https://www.getDocument.com/doc/api/f...";
var xhr = new XMLHttpRequest();
xhr.open("GET", URL);
xhr.responseType = "arraybuffer";

xhr.onload = function () {
if (this.status === 200) {
var blob = new Blob([xhr.response], {type: "application/pdf"});
var objectUrl = URL.createObjectURL(blob);
return objectUrl;
}
};
xhr.send();

But this piece does not work with Server Code. I am getting error as ""XMLHttpRequest" is not defined".

How do I handle such chunked data using XHR?
How can we have the onload even with XHR?

Why is "XMLHttpRequest" not supported at Server Code?

I even tried with creating a library, but that gave me the same error.
1 person has
this problem
+1
Reply