Coder Social home page Coder Social logo

Comments (7)

anthumchris avatar anthumchris commented on May 20, 2024

This implementation was also posted for discussion and resolution on Stack Overflow

https://stackoverflow.com/questions/49085424/

from fetch-progress-indicators.

fselcukcan avatar fselcukcan commented on May 20, 2024

@anthumchris SO says Page Not Found.
What is controller up in the original post.

from fetch-progress-indicators.

anthumchris avatar anthumchris commented on May 20, 2024

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

from fetch-progress-indicators.

fselcukcan avatar fselcukcan commented on May 20, 2024

First link is still Not Found but thanks. I will read Streams API on mdn.

from fetch-progress-indicators.

anthumchris avatar anthumchris commented on May 20, 2024

I wonder if StackOverflow is doing some special geo-based redirection. You could also try searching (with quotes) "Constructing Fetch Request with ReadableStream Body" and click the first result:

image

from fetch-progress-indicators.

aeimi avatar aeimi commented on May 20, 2024

I wonder if StackOverflow is doing some special geo-based redirection. You could also try searching (with quotes) "Constructing Fetch Request with ReadableStream Body" and click the first result:

Cannot find this in any way.

from fetch-progress-indicators.

anthumchris avatar anthumchris commented on May 20, 2024

A ReadableStream can now be sent as a fetch() request body (see whatwg/fetch#425). I'll plan on adding an example for upload progress indicators.

@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 (https://stackoverflow.com/questions/49085424/), It was marked as a duplicate question and deleted.

from fetch-progress-indicators.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.