- From: bORm <notifications@github.com>
- Date: Fri, 16 Sep 2016 10:24:12 -0700
- To: whatwg/fetch <fetch@noreply.github.com>
Received on Friday, 16 September 2016 17:24:53 UTC
Okay,
```
function consume(reader) {
var total = 0
return pump()
function pump() {
return reader.read().then(({done, value}) => {
if (done) {
return
}
total += value.byteLength
log(`received ${value.byteLength} bytes (${total} bytes in total)`)
return pump()
})
}
}
fetch("/music/pk/altes-kamuffel.flac")
.then(res => consume(res.body.getReader()))
.then(res => return res.json())
.then((resultFromServer) => log(resultFromServer.file))
.catch(e => log("something went wrong: " + e))
```
how return real response.json() from Server?
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/21#issuecomment-247658295
Received on Friday, 16 September 2016 17:24:53 UTC