const text = "Hello world";
const request = new Request("/myEndpoint", {
method: "POST",
body: text,
});
request.text().then((text) => {
// do something with the text sent in the request
});Request: text() method / notebook
Request: text() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.