Request: body-Eigenschaft
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Hinweis: Diese Funktion ist in Web Workers verfügbar.
Die schreibgeschützte body
-Eigenschaft der Request
-Schnittstelle enthält einen ReadableStream
mit dem Inhalt des Bodys, der der Anfrage hinzugefügt wurde. Beachten Sie, dass eine Anfrage, die die GET
- oder HEAD
-Methode verwendet, keinen Body haben kann und in diesen Fällen null
zurückgegeben wird.
Wert
Ein ReadableStream
oder null
.
Beispiele
js
const request = new Request("/myEndpoint", {
method: "POST",
body: "Hello world",
});
request.body; // ReadableStream
Spezifikationen
Specification |
---|
Fetch # ref-for-dom-body-body① |
Browser-Kompatibilität
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.