title: Reading byte array response from rest using Javascript
body: <p>I have a rest url <code>http://server1:8080/platform/collections/123-456-789</code> which returns an HTML file as a byte array.</p>
  
  <p>How can I get the byte array response using Javascript or jQuery running in server2. I tried</p>
  
  <pre><code>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);
          }
  });
  </code></pre>
  
  <p>I don't go into the success method. How can I get the byte array response successfully?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Even anyother way to get byte array responce using javascript or jquery is also appreciated</p>