I have a rest url http://server1:8080/platform/collections/123-456-789
which returns an HTML file as a byte array.
How can I get the byte array response using Javascript or jQuery running in server2. I tried
jQuery.ajax({
url: "http://server1:8080/platform/collections/123-456-789",
type: "GET",
dataType: "html",
crossDomain: true,
username: "abcd",
password: "abcd",
async: true,
success: function(data) {
alert("1");
alert(data);
},
error: function (xhr, ajaxOptions, thrownError) {
alert("error"+xhr.responseText);
alert("error"+thrownError);
}
});
I don't go into the success method. How can I get the byte array response successfully?
Edit:
Even anyother way to get byte array responce using javascript or jquery is also appreciated