This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The body read-only property of the Body mixin is a simple getter used to expose a ReadableStream of the body contents.


var stream = responseInstance.body;


A ReadableStream.


In our simple stream pump example we fetch an image, expose the response's stream using response.body, create a reader using ReadableStream.getReader(), then enqueue that stream's chunks into a second, custom readable stream — effectively creating an identical copy of the image.

const image = document.getElementById('target');

// Fetch the original image
// Retrieve its body as ReadableStream
.then(response => response.body)
.then(body => {
  const reader = body.getReader();

  return new ReadableStream({
    start(controller) {
      return pump();

      function pump() {
        return{ done, value }) => {
          // When no more data needs to be consumed, close the stream
          if (done) {

          // Enqueue the next data chunk into our target stream
          return pump();
.then(stream => new Response(stream))
.then(response => response.blob())
.then(blob => URL.createObjectURL(blob))
.then(url => console.log(image.src = url))
.catch(err => console.error(err));


Specification Status Comment
The definition of 'body' in that specification.
Living Standard  

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support52 Yes No1 No39 ?
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support5252 ? No139 ?6.0

1. This feature is behind the dom.streams.enabled preference and the javascript.options.streams preference. To change preferences in Firefox, visit about:config.

See also

Document Tags and Contributors

Contributors to this page: jcsahnwaldt, fscholz, chrisdavidmills
Last updated by: jcsahnwaldt,