Skip to content

Commit 82d0b86

Browse files
committed
initial
1 parent eb11e35 commit 82d0b86

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

fetch.bs

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Markup Shorthands: css off
1515
!Commits: [SNAPSHOT-LINK]
1616
!Commits: <a href=https://twitter.com/fetchstandard>@fetchstandard</a>
1717
!Translation (non-normative): <span title=Japanese><a href=https://triple-underscore.github.io/Fetch-ja.html lang=ja hreflang=ja rel=alternate>日本語</a></span>
18-
Translate IDs: typedefdef-bodyinit bodyinit,typedefdef-responsebodyinit responsebodyinit,dictdef-requestinit requestinit,typedefdef-requestinfo requestinfo,enumdef-requesttype requesttype,enumdef-requestdestination requestdestination,enumdef-requestmode requestmode,enumdef-requestcredentials requestcredentials,enumdef-requestcache requestcache,enumdef-requestredirect requestredirect,dictdef-responseinit responseinit,enumdef-responsetype responsetype
18+
Translate IDs: typedefdef-bodyinit bodyinit,dictdef-requestinit requestinit,typedefdef-requestinfo requestinfo,enumdef-requesttype requesttype,enumdef-requestdestination requestdestination,enumdef-requestmode requestmode,enumdef-requestcredentials requestcredentials,enumdef-requestcache requestcache,enumdef-requestredirect requestredirect,dictdef-responseinit responseinit,enumdef-responsetype responsetype
1919
</pre>
2020

2121
<script src=https://resources.whatwg.org/file-issue.js async></script>
@@ -589,6 +589,9 @@ user-agent-defined <a for=header>value</a> for the
589589

590590
<li><p>A <dfn export for=body id=concept-body-total-bytes>total bytes</dfn> (an
591591
integer), initially 0.
592+
593+
<li><p>A <dfn export for=body id=concept-body-replayable>replayable flag</dfn> (a boolean),
594+
initially false.
592595
</ul>
593596

594597
<p>A <a for=/>body</a> <var>body</var> is said to be
@@ -3025,6 +3028,11 @@ in addition to <a>HTTP fetch</a> above.
30253028
<a lt="include credential">includes credentials</a>, then return a
30263029
<a>network error</a>.
30273030

3031+
<li><p>If <var>request</var>'s <a for=request>method</a> is not <code>303</code>,
3032+
<var>request</var>'s <a for=request>body</a> is not null, and <var>request</var>'s
3033+
<a for=request>body</a>'s <a for=body>replayable flag</a> is false, then return a
3034+
<a>network error</a>.
3035+
30283036
<li>
30293037
<p>If <i>CORS flag</i> is set and <var>actualResponse</var>'s
30303038
<a for=response>location URL</a>
@@ -3366,6 +3374,10 @@ steps:
33663374
<li class=XXX><p>Needs testing: multiple `<code>WWW-Authenticate</code>` headers, missing,
33673375
parsing issues.
33683376

3377+
<li><p>If <var>request</var>'s <a for=request>body</a> is not null and <var>request</var>'s
3378+
<a for=request>body</a>'s <a for=body>replayable flag</a> is false, then return a
3379+
<a>network error</a>.
3380+
33693381
<li>
33703382
<p>If <var>request</var>'s
33713383
<a for=request>use-URL-credentials flag</a> is unset or
@@ -4240,9 +4252,7 @@ method, when invoked, must run these steps:
42404252
<h3 id=body-mixin>Body mixin</h3>
42414253

42424254
<pre class=idl>
4243-
typedef (Blob or BufferSource or FormData or URLSearchParams or USVString) BodyInit;
4244-
4245-
typedef (BodyInit or ReadableStream) ResponseBodyInit;</pre>
4255+
typedef (Blob or BufferSource or FormData or URLSearchParams or USVString or ReadableStream) BodyInit;</pre>
42464256

42474257
<p>To <dfn id=concept-bodyinit-extract for=BodyInit export>extract</dfn> a <a for=/>body</a> and a
42484258
`<code>Content-Type</code>` <a for=header>value</a> from
@@ -4255,7 +4265,9 @@ typedef (BodyInit or ReadableStream) ResponseBodyInit;</pre>
42554265

42564266
<li><p>Let <var>Content-Type</var> be null.
42574267

4258-
<li><p>Let <var>action</var> be null.
4268+
<li><p>Let <var>action</var> be null.
4269+
4270+
<li><p>Let <var>replayable</var> be false.
42594271

42604272
<li>
42614273
<p>Switch on <var>object</var>'s type:
@@ -4268,6 +4280,8 @@ typedef (BodyInit or ReadableStream) ResponseBodyInit;</pre>
42684280
<p>If <var>object</var>'s {{Blob/type}}
42694281
attribute is not the empty byte sequence, set <var>Content-Type</var> to its value.
42704282

4283+
<p>Set <var>replayable</var> to true.
4284+
42714285
<dt><code>BufferSource</code>
42724286
<dd>
42734287
<p><a for=ReadableStream>Enqueue</a> a <code>Uint8Array</code> object
@@ -4276,6 +4290,8 @@ typedef (BodyInit or ReadableStream) ResponseBodyInit;</pre>
42764290
<var>stream</var>. If that threw an exception,
42774291
<a abstract-op>error</a> <var>stream</var> with that exception.
42784292

4293+
<p>Set <var>replayable</var> to true.
4294+
42794295
<dt>{{FormData}}
42804296
<dd>
42814297
<p>Set <var>action</var> to an action that runs the
@@ -4288,6 +4304,8 @@ typedef (BodyInit or ReadableStream) ResponseBodyInit;</pre>
42884304
<a><code>multipart/form-data</code> boundary string</a> generated by the
42894305
<a><code>multipart/form-data</code> encoding algorithm</a>.
42904306

4307+
<p>Set <var>replayable</var> to true.
4308+
42914309
<dt>{{URLSearchParams}}
42924310
<dd>
42934311
<p>Set <var>action</var> to an action that runs the
@@ -4299,12 +4317,16 @@ typedef (BodyInit or ReadableStream) ResponseBodyInit;</pre>
42994317
<p>Set <var>Content-Type</var> to
43004318
`<code>application/x-www-form-urlencoded;charset=UTF-8</code>`.
43014319

4320+
<p>Set <var>replayable</var> to true.
4321+
43024322
<dt><code>USVString</code>
43034323
<dd>
43044324
<p>Set <var>action</var> to an action that runs <a>utf-8 encode</a> on <var>object</var>.
43054325

43064326
<p>Set <var>Content-Type</var> to `<code>text/plain;charset=UTF-8</code>`.
43074327

4328+
<p>Set <var>replayable</var> to true.
4329+
43084330
<dt>{{ReadableStream}}
43094331
<dd><p>Set <var>stream</var> to <var>object</var>.
43104332
</dl>
@@ -4329,7 +4351,8 @@ typedef (BodyInit or ReadableStream) ResponseBodyInit;</pre>
43294351
</ol>
43304352

43314353
<li><p>Let <var>body</var> be a <a for=/>body</a> whose
4332-
<a for=body>stream</a> is <var>stream</var>.
4354+
<a for=body>stream</a> is <var>stream</var> and <a for=body>replayable flag</a> is
4355+
<var>replayable</var>.
43334356

43344357
<li><p>Return <var>body</var> and <var>Content-Type</var>.
43354358
</ol>
@@ -4956,7 +4979,7 @@ run these steps:
49564979

49574980
<h3 id=response-class>Response class</h3>
49584981

4959-
<pre class=idl>[Constructor(optional ResponseBodyInit? body = null, optional ResponseInit init),
4982+
<pre class=idl>[Constructor(optional BodyInit? body = null, optional ResponseInit init),
49604983
Exposed=(Window,Worker)]
49614984
interface Response {
49624985
[NewObject] static Response error();

0 commit comments

Comments
 (0)