New issue
Advanced search Search tips

Issue 701540 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 688906
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Feature



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 description

Currently 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.

 
progress awareness.js
179 bytes View Download
send events in single request.js
271 bytes View Download
Labels: Needs-Milestone
Labels: TE-NeedsTriageHelp
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

Comment 4 by ricea@chromium.org, Mar 21 2017

Components: Blink>Network>StreamsAPI Blink>Network>FetchAPI
Labels: -OS-Windows -Type-Bug -TE-NeedsTriageHelp -Needs-Milestone OS-All Type-Feature
Mergedinto: 688906
Owner: yhirano@chromium.org
Status: Duplicate (was: Unconfirmed)
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
#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