Re: XMLHttpRequest.responseBlob

On Mon, Apr 26, 2010 at 3:21 PM, Darin Fisher <darin@chromium.org> wrote:
> There is some interest from application developers at Google in being able
> to get a Blob corresponding to the response body of a XMLHttpRequest.
> The use case is to improve the efficiency of getting a Blob from a binary
> resource downloaded via XHR.
> The alternative is to play games with character encodings so that
> responseText can be used to fetch an image as a string, and then use
> BlobBuilder to reconstruct the image file, again being careful with the
> implicit character conversions.  All of this is very inefficient.
> Is there any appetite for adding a responseBlob getter on XHR?

There has been talk about exposing a responseBody property which would
contain the binary response. However ECMAScript is still lacking a
binary type.

Blob does fit the bill in that it represents binary data, however it's
asynchronous nature is probably not ideal here, right?

/ Jonas

Received on Monday, 26 April 2010 22:30:23 UTC