Re: [XHR2] responseType / response / overrideMimeType proposal

On Mon, 29 Nov 2010 18:21:44 +0100, Anne van Kesteren <annevk@opera.com>  
wrote:
> Before I write it out it would be nice to assess whether there is  
> consensus on this. From the current draft, asBlob, responseBlob, and  
> responseArrayBuffer are removed. response and responseType are added.

http://dev.w3.org/2006/webapi/XMLHttpRequest-2/

responseType takes the empty string, "text", "document", and "blob" as  
values. I left out "arraybuffer" awaiting TC39 verdict.

I waited with overrideMimeType changes. Can we actually start throwing for  
it? Anyone a good proposal for how it should work?

responseText throws when responseType is not the empty string or "text".  
responseXML throws when responseType is not the empty string or  
"document". response returns responseText by default and never throws.

When responseType is "blob" response always returns a Blob object,  
potentially empty if the response entity body is empty.


(I also removed followRedirects because its design was controversial.)


Feedback very much appreciated.


-- 
Anne van Kesteren
http://annevankesteren.nl/

Received on Tuesday, 30 November 2010 15:40:43 UTC