| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/en-US/docs/Web/API/TextEncoderStream/TextEncoderStream | [Back] [Original] |
Get to know MDN better
This feature is well established and works across many devices and browser versions. Its been available across browsers since September 2022.
Note: This feature is available in Web Workers.
The TextEncoderStream() constructor creates a new TextEncoderStream object which is used to convert a stream of strings into bytes using UTF-8 encoding.
new TextEncoderStream()
None.
In this example a TextEncoderStream is created and used to upload a stream of text.
const body = textStream.pipeThrough(new TextEncoderStream());
fetch("/dest", {
method: "POST",
body,
headers: { "Content-Type": "text/plain; charset=UTF-8" },
});
| Specification |
|---|
| Encoding # ref-for-dom-textencoderstream |
This page was last modified on Sep 25, 2024 by MDN contributors.
TextEncoderStreamYour blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |