Requesting the resource as a "blob" or "arraybuffer" is something new to xhr and is quite useful for working with binary data
In case of responseType is not text (arraybuffer, blob, document), the data passed to callback should be xhr.response, instead of xhr.responseText.
IIRC, Chrome sets xhr.response also in the responseType='', responseType='text' cases.
But that could very well be in implementation divergence from the spec.
feat($http): support reponseType
I'm trying to get binary data (a simple jpeg image) with responseType: 'blob' (also tried 'arraybuffer'), but the data property of the response object is always a string instead of a Blob object. Am I doing something wrong? This issue is closed, so it should work, right?
Ok I found out it didn't work because I was using ngMockE2E. However, I specified to passThrough() the request - it seems like $httpBackend swallows the responseType parameter.