Request: body property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Note: This feature is available in Web Workers.

The body read-only property of the Request interface contains a ReadableStream with the body contents that have been added to the request. Note that a request using the GET or HEAD method cannot have a body and null is returned in these cases.

Value

A ReadableStream or null.

Examples

js
const request = new Request("/myEndpoint", {
  method: "POST",
  body: "Hello world",
});

request.body; // ReadableStream

Specifications

Specification
Fetch
# ref-for-dom-body-body①

Browser compatibility

desktop mobile server
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Bun
Deno
Node.js
body
Chrome – Full support
Chrome 105 (Release date: 2022-09-02)
footnote
footnote See bug 40505032
Edge – Full support
Edge 105 (Release date: 2022-09-01)
footnote
footnote See bug 40505032
Firefox – No support
Firefox
footnote
footnote See bug 1387483
Opera – Full support
Opera 91 (Release date: 2022-09-14)
footnote
footnote See bug 40505032
Safari – Full support
Safari 11.1 (Release date: 2018-04-12)
footnote Full support
Chrome Android – Full support
Chrome Android 105 (Release date: 2022-09-02)
footnote
footnote See bug 40505032
Firefox for Android – No support
Firefox for Android
footnote
footnote See bug 1387483
Opera Android – Full support
Opera Android 72 (Release date: 2022-10-21)
footnote
footnote See bug 40505032
Safari on iOS – Full support
Safari on iOS 11.3 (Release date: 2018-03-29)
footnote Full support
Samsung Internet – Full support
Samsung Internet 20 (Release date: 2023-02-10)
footnote
footnote See bug 40505032
WebView Android – Full support
WebView Android 105 (Release date: 2022-09-02)
footnote
footnote See bug 40505032
WebView on iOS – Full support
WebView on iOS 11.3 (Release date: 2018-03-29)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1 (Release date: 2020-05-13)
footnote Full support
Node.js – Full support
Node.js 18 (Release date: 2022-04-19)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.

See also