Re: [whatwg/fetch] Add a textStream() method to the Body mixin (PR #1862)

@foolip commented on this pull request.



> @@ -8246,6 +8250,20 @@ of running <a for=Body>consume body</a> with <a>this</a> and <a>parse JSON from
 of running <a for=Body>consume body</a> with <a>this</a> and <a>UTF-8 decode</a>.
 </div>
 
+<div algorithm>
+<p>The <dfn method for=Body><code>textStream()</code></dfn> method steps are:</p>
+
+<ol>
+ <li><p>If <span>this</span>'s <a for=Body>body</a> is null, throw a {{TypeError}}.
+
+ <li><p>Let <var>stream</var> be <a>this</a>'s <a for=Body>body</a>'s <a for=body>stream</a>.
+
+ <li><p>Let <var>decoder</var> be a new {{TextDecoderStream}} object.
+
+ <li><p>Return the result of piping <var>stream</var> through <var>decoder</var>.

Here "pipe through" would need to link to something. I'm not sure if there are other APIs that internally do something similar that I could copy?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/1862#pullrequestreview-3294326330
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/pull/1862/review/3294326330@github.com>

Received on Thursday, 2 October 2025 12:21:34 UTC