Request: body プロパティ

Limited availability

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

メモ: この機能はウェブワーカー内で利用可能です。

bodyRequest インターフェイスの読み取り専用プロパティで、リクエストに追加された本体のコンテンツを含む ReadableStream を保持します。 GETHEAD メソッドを使用したリクエストは本体を持つことができず、その場合は null が返されることに注意してください。

ReadableStream または null

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

request.body; // ReadableStream

仕様書

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

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
body

Legend

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

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

関連情報