Issue metadata
Sign in to add a comment
|
Implement ReadableStream for the Fetch API's Request body
Reported by
mahdi.ne...@gmail.com,
Mar 14 2017
|
||||||||||||||||||||||||
Issue descriptionCurrently Request can be created from various body types, - USVString - BufferSource - Blob - FormData - URLSearchParams . Adding ReadableStream to the list is useful because it allows a developer to create a request with an author-created stream. For example: - a developer can aware uploaded-bytes of the stream, without needing xhr.upload.progress event; - a developer can send the events in single request.
,
Mar 15 2017
,
Mar 15 2017
The Google Chrome supports feature "Streaming response body" from version 43. Request and Response are two sides of the coin. It's great that this feature be added
,
Mar 21 2017
,
May 11 2017
Is this really solved for requests as well, such as ones initiated with the Fetch API? I am trying:
fetch("/foobar", { method: "POST", body: new ReadableStream({ pull: function(controller) { controller.enqueue("baz"); } }) });
Expecting a continuous stream of "baz" like "bazbazbazbazbaz..." making up the body of the request, as assembled by an infinite series of `pull()` calls, all being sent on the network, trailing headers, as part of a chunked encoding transfer scheme.
Instead, none of request body gets sent anywhere, `pull()` is only called once, and on server end there are headers arriving like `Content-Length: 0`, and most importantly I don't see any `Transfer-Encoding: chunked` (which is what I would expect since even the client can't know the stream size in advance).
Is this a sign of a regression? As in, implemented but broken by something else since?
Tested with:
* Chrome 58.0.3029.110 (rev. 691bdb490962d4e6ae7f25c6ab1fdd0faaf19cd0-refs/branch-heads/3029@{#830})
* Chrome Canary 60.0.3095.5 (rev. 72e83b35450360b17a9d1f70e30c86d7a881ec34-refs/branch-heads/3095@{#5})
Command-line flags: --disable-web-security --enable-experimental-web-platform-features
Platform: Windows 7 SP1 x86_64
,
May 12 2017
#5: as you can see by following the link to issue 688906, which this issue was duplicated against, the work is still being done. |
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by ranjitkan@chromium.org
, Mar 15 2017