RE: [XHR]

       Thanks for the information. The "moz-blob" data type looks like it would work, but I need a cross-browser solution in the near future, for new browsers at least. It looks like I might need to fall back on a WebSocket solution with a proprietary protocol between the WebSocket server and applications. 
       
       The annoying thing is that the W3C XMLHttpRequest() specification of August 2009 contained exactly what I need:
       
        The responseBody attribute, on getting, must return the result of running the following steps:
       
        If the state is not LOADING or DONE raise an INVALID_STATE_ERR exception and terminate these steps.
       
        Return a ByteArray object representing the response entity body or return null if the response entity body is null.
       
       Thus, for byteArray data one could access the partially delivered response. For some reason a restriction was added later that removed this capability, by changing "If the state is not LOADING or DONE" to "If the state is not DONE" for all data types except "text". Alas. I still don't understand why W3C and WHATWG added this restriction. Normally new releases of a standard add capabilities, rather than taking them away. It is especially puzzling in this situation, since it basically blows off the IETF RFC 7230 requirement that HTTP clients must support chunked responses. 
       
       Regards, Gomer
       
       --
       Gomer Thomas Consulting, LLC
       9810 132nd St NE
       Arlington, WA 98223
       Cell: 425-309-9933
       
       
       -----Original Message-----
From: Jonas Sicking [mailto:jonas@sicking.cc] 
Sent: Wednesday, March 16, 2016 1:01 PM
To: Gomer Thomas <gomer@gomert-consulting.com>
Cc: Hallvord Reiar Michaelsen Steen <hsteen@mozilla.com>; WebApps WG <public-webapps@w3.org>
Subject: Re: [XHR]
       
       Sounds like you want access to partial binary data.
       
       There's some propitiatory features in Firefox which lets you do this (added ages ago). See [1]. However for a cross-platform solution we're still waiting for streams to be available.
       
       Hopefully that should be soon, but of course cross-browser support across all major browsers will take a while. Even longer if you want to be compatible with old browsers still in common use.
       
       [1] https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseType
       
       / Jonas
       
       On Wed, Mar 16, 2016 at 12:27 PM, Gomer Thomas <gomer@gomert-consulting.com> wrote:
       >        In my case the object being transmitted is an ISO BMFF file (as a blob), and I want to be able to present the samples in the file as they arrive, rather than wait until the entire file has been received.
       >        Regards, Gomer
       >
       >        --
       >        Gomer Thomas Consulting, LLC
       >        9810 132nd St NE
       >        Arlington, WA 98223
       >        Cell: 425-309-9933
       >
       >
       >        -----Original Message-----
       > From: Hallvord Reiar Michaelsen Steen [mailto:hsteen@mozilla.com]
       > Sent: Wednesday, March 16, 2016 4:04 AM
       > To: Gomer Thomas <gomer@gomert-consulting.com>
       > Cc: WebApps WG <public-webapps@w3.org>
       > Subject: Re: [XHR]
       >
       >        On Tue, Mar 15, 2016 at 11:19 PM, Gomer Thomas <gomer@gomert-consulting.com> wrote:
       >
       >        > According to IETF RFC 7230 all HTTP recipients “MUST be able to parse
       >        > the chunked transfer coding”. The logical interpretation of this is
       >        > that whenever possible HTTP recipients should deliver the chunks to
       >        > the application as they are received, rather than waiting for the
       >        > entire response to be received before delivering anything.
       >        >
       >        > In the latest version this can only be done for “text” responses. For
       >        > any other type of response, the “response” attribute returns “null”
       >        > until the transmission is completed.
       >
       >        How would you parse for example an incomplete JSON source to expose an object? Or incomplete XML markup to create a document? Exposing partial responses for text makes sense - for other types of data perhaps not so much.
       >        -Hallvord
       >
       >

Received on Wednesday, 16 March 2016 20:54:45 UTC