@@ -7162,6 +7162,7 @@ interface mixin Body {
7162
7162
readonly attribute boolean bodyUsed;
7163
7163
[NewObject] Promise<ArrayBuffer> arrayBuffer();
7164
7164
[NewObject] Promise<Blob> blob();
7165
+ [NewObject] Promise<Uint8Array> bytes();
7165
7166
[NewObject] Promise<FormData> formData();
7166
7167
[NewObject] Promise<any> json();
7167
7168
[NewObject] Promise<USVString> text();
@@ -7195,6 +7196,9 @@ due course.
7195
7196
<dt><code><var> requestOrResponse</var> . <a method for=Body>blob</a> ()</code>
7196
7197
<dd><p> Returns a promise fulfilled with <var> requestOrResponse</var> 's body as {{Blob}} .
7197
7198
7199
+ <dt><code><var> requestOrResponse</var> . <a method for=Body>bytes</a> ()</code>
7200
+ <dd><p> Returns a promise fulfilled with <var> requestOrResponse</var> 's body as {{Uint8Array}} .
7201
+
7198
7202
<dt><code><var> requestOrResponse</var> . <a method for=Body>formData</a> ()</code>
7199
7203
<dd><p> Returns a promise fulfilled with <var> requestOrResponse</var> 's body as {{FormData}} .
7200
7204
@@ -7290,6 +7294,15 @@ and whose {{Blob/type}} attribute is the result of <a for=Body>get the MIME type
7290
7294
<!-- This is wrong. It should really set an underlying concept to this. -->
7291
7295
</div>
7292
7296
7297
+ <div algorithm>
7298
+ <p> The <dfn method for=Body><code>bytes()</code></dfn> method steps are to return the result
7299
+ of running <a for=Body>consume body</a> with <a>this</a> and the following step given a
7300
+ <a for=/>byte sequence</a> <var> bytes</var> : return the result of [=ArrayBufferView/create|creating=] a
7301
+ {{Uint8Array}} from <var> bytes</var> in <a>this</a> 's <a>relevant realm</a> .
7302
+
7303
+ <p class="note"> The above method can reject with a {{RangeError}} .
7304
+ </div>
7305
+
7293
7306
<div algorithm>
7294
7307
<p> The <dfn method for=Body><code>formData()</code></dfn> method steps are to return the result of
7295
7308
running <a for=Body>consume body</a> with <a>this</a> and the following steps given a
0 commit comments