Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce RequestInit.duplex #1457

Merged
merged 7 commits into from
Jul 1, 2022
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -6784,6 +6784,7 @@ dictionary RequestInit {
DOMString integrity;
boolean keepalive;
AbortSignal? signal;
RequestDuplex? duplex;
yutakahirano marked this conversation as resolved.
Show resolved Hide resolved
any window; // can only be set to null
};

Expand All @@ -6792,6 +6793,7 @@ enum RequestMode { "navigate", "same-origin", "no-cors", "cors" };
enum RequestCredentials { "omit", "same-origin", "include" };
enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" };
enum RequestRedirect { "follow", "error", "manual" };
enum RequestDuplex { "half", "full" };
yutakahirano marked this conversation as resolved.
Show resolved Hide resolved
</pre>

<p class="note no-backref">"<code>serviceworker</code>" is omitted from
Expand Down Expand Up @@ -6880,7 +6882,15 @@ object), initially null.

<dt>{{RequestInit/window}}
<dd>Can only be null. Used to disassociate <var>request</var> from any {{Window}}.
</dl>

<dt>{{RequestInit/duplex}}
<dd>"half" for initiating a half-duplex (i.e., the user agent send all the request content
before starting receiving the response) fetch, and "full" for initiating a full-duplex (i.e.,
the user agent starts receiving the response before sending all the request content) fetch.
This needs to be set when {{RequestInit/body}} is a {{ReadableStream}}. <span class=note>The
semantics for "full" have not been specified yet. See
<a href="https://github.com/whatwg/fetch/issues/1254">issue #1254</a>.</span>
yutakahirano marked this conversation as resolved.
Show resolved Hide resolved
</dl>

<dt><code><var>request</var> . <a attribute for=Request>method</a></code>
<dd>Returns <var>request</var>'s HTTP method, which is "<code>GET</code>" by default.
Expand Down Expand Up @@ -7305,11 +7315,16 @@ constructor steps are:
<li><p>Let <var>inputOrInitBody</var> be <var>initBody</var> if it is non-null; otherwise
<var>inputBody</var>.

<li><p>If <var>init</var>["{{RequestInit/duplex}}"] is "full", then throw a {{TypeError}}.
yutakahirano marked this conversation as resolved.
Show resolved Hide resolved

<li>
<p>If <var>inputOrInitBody</var> is non-null and <var>inputOrInitBody</var>'s
<a for=body>source</a> is null, then:

<ol>
<li><p>If <var>initBody</var> is non-null and <var>init</var>["{{RequestInit/duplex}}"] does
not <a for=map>exist</a>, then throw a {{TypeError}}.

<li><p>If <a>this</a>'s <a for=Request>request</a>'s <a for=request>mode</a> is neither
"<code>same-origin</code>" nor "<code>cors</code>", then throw a {{TypeError}}.

Expand Down