Request.body
The read-only body
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 return in these cases.
Syntax
request.body
Value
A ReadableStream
or null
.
Examples
const request = new Request('/myEndpoint', { method: 'POST', body: 'Hello world' }); request.body; // ReadableStream
Specifications
Specification |
---|
Fetch Standard (Fetch) # ref-for-dom-body-body① |
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
body |
No
See bug 688906.
|
No |
No
See bug 1387483.
|
No |
No |
11.1 |
No |
No
See bug 688906.
|
No
See bug 1387483.
|
No |
11.3 |
No |
See also
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Request/body