Request: body property
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 Standard # ref-for-dom-body-body① |
Browser compatibility
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
body |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.