Firefox Tomorrow

web api instance property

Request: bodyUsed property

View on MDN ↗

Available in workers

The bodyUsed read-only property of the Request interface is a boolean value that indicates whether the request body has been read yet.

Value

A boolean value.

Examples

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

request.bodyUsed; // false

request.text().then((bodyAsText) => {
  console.log(request.bodyUsed); // true
});

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also