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

BCD tables only load in the browser

See also