-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Example for File Upload #6
Comments
This implementation was also posted for discussion and resolution on Stack Overflow |
@anthumchris SO says Page Not Found. |
StackOverflow redirects to this: https://stackoverflow.com/questions/49085424/constructing-fetch-request-with-readablestream-body does that work for you? MDN has some good info on the controller, and I recommend starting here: https://developer.mozilla.org/en-US/docs/Web/API/Streams_API/Using_readable_streams |
First link is still Not Found but thanks. I will read Streams API on mdn. |
Cannot find this in any way. |
A @jakearchibald wrote great article Streaming requests with the fetch API. This example shows a server responding with the streaming request it receives: Demo: https://jsbin.com/piwewop/edit?js,output fetch(new Request('https://dev.anthum.com/post-stream-test/', {
body: new Response('🎉').body, // new ReadableStream
duplex: 'half',
method: 'POST',
headers: { 'Content-Type': 'text/plain' },
}))
.then(response => response.text())
.then(console.log)
.catch(console.error) _@amdiv, @fselcukcan: Apologies, please ignore original StackOverflow URL ( |
Progress indicators for file uploads (specifically indicators for
Request
objects) would be a great example. At the time of writing, this doesn't seem possible yet, and the Request docs do indicateReadableStream
may be used as a request bodyString body: sent
ReadableStream body: not sent
This may just be bad experimental code on my part or the browsers do not yet support it.
The text was updated successfully, but these errors were encountered: