fetch icon indicating copy to clipboard operation
fetch copied to clipboard

fetch response body as ReadableStream

Open mbiegert opened this issue 2 years ago • 3 comments

Hello there, from what I can gather from mdn the fetch specification defines the return value to resolve to a response object that has a body property that is a "ReadableStream". This means that we can get the response "bit by bit" as soon as it arrives instead of waiting for the whole request to finish. This fetch implementation only resolves to a response after the "load" event has been fired on the XHR object, which only happens once the whole body is received.

It looks to me like this part of the specification is missing, was it intentionally left out because it's too complex or what are the reasons behind that? I'm trying to implement an EventSource listener in react-native which uses this library as a fetch polyfill.

mbiegert avatar Mar 03 '22 09:03 mbiegert

hi, Can i work on this?

ritikBhandari avatar Mar 17 '22 15:03 ritikBhandari

@ritikBhandari yes you can 👍

JakeChampion avatar Mar 18 '22 12:03 JakeChampion

It seems they will not add the property . https://github.com/github/fetch/issues/198#issuecomment-494361060

Damoness avatar Jul 13 '22 08:07 Damoness

Closing as a duplicate of https://github.com/github/fetch/issues/746

JakeChampion avatar Apr 15 '23 12:04 JakeChampion