Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
yutakahirano committed Nov 28, 2016
1 parent eb11e35 commit 82d0b86
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions fetch.bs
Expand Up @@ -15,7 +15,7 @@ Markup Shorthands: css off
!Commits: [SNAPSHOT-LINK]
!Commits: <a href=https://twitter.com/fetchstandard>@fetchstandard</a>
!Translation (non-normative): <span title=Japanese><a href=https://triple-underscore.github.io/Fetch-ja.html lang=ja hreflang=ja rel=alternate>日本語</a></span>
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
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
</pre>

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

<li><p>A <dfn export for=body id=concept-body-total-bytes>total bytes</dfn> (an
integer), initially 0.

<li><p>A <dfn export for=body id=concept-body-replayable>replayable flag</dfn> (a boolean),
initially false.
</ul>

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

<li><p>If <var>request</var>'s <a for=request>method</a> is not <code>303</code>,
<var>request</var>'s <a for=request>body</a> is not null, and <var>request</var>'s
<a for=request>body</a>'s <a for=body>replayable flag</a> is false, then return a
<a>network error</a>.

<li>
<p>If <i>CORS flag</i> is set and <var>actualResponse</var>'s
<a for=response>location URL</a>
Expand Down Expand Up @@ -3366,6 +3374,10 @@ steps:
<li class=XXX><p>Needs testing: multiple `<code>WWW-Authenticate</code>` headers, missing,
parsing issues.

<li><p>If <var>request</var>'s <a for=request>body</a> is not null and <var>request</var>'s
<a for=request>body</a>'s <a for=body>replayable flag</a> is false, then return a
<a>network error</a>.

<li>
<p>If <var>request</var>'s
<a for=request>use-URL-credentials flag</a> is unset or
Expand Down Expand Up @@ -4240,9 +4252,7 @@ method, when invoked, must run these steps:
<h3 id=body-mixin>Body mixin</h3>

<pre class=idl>
typedef (Blob or BufferSource or FormData or URLSearchParams or USVString) BodyInit;

typedef (BodyInit or ReadableStream) ResponseBodyInit;</pre>
typedef (Blob or BufferSource or FormData or URLSearchParams or USVString or ReadableStream) BodyInit;</pre>

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

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

<li><p>Let <var>action</var> be null.
<li><p>Let <var>action</var> be null.

<li><p>Let <var>replayable</var> be false.

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

<p>Set <var>replayable</var> to true.

<dt><code>BufferSource</code>
<dd>
<p><a for=ReadableStream>Enqueue</a> a <code>Uint8Array</code> object
Expand All @@ -4276,6 +4290,8 @@ typedef (BodyInit or ReadableStream) ResponseBodyInit;</pre>
<var>stream</var>. If that threw an exception,
<a abstract-op>error</a> <var>stream</var> with that exception.

<p>Set <var>replayable</var> to true.

<dt>{{FormData}}
<dd>
<p>Set <var>action</var> to an action that runs the
Expand All @@ -4288,6 +4304,8 @@ typedef (BodyInit or ReadableStream) ResponseBodyInit;</pre>
<a><code>multipart/form-data</code> boundary string</a> generated by the
<a><code>multipart/form-data</code> encoding algorithm</a>.

<p>Set <var>replayable</var> to true.

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

<p>Set <var>replayable</var> to true.

<dt><code>USVString</code>
<dd>
<p>Set <var>action</var> to an action that runs <a>utf-8 encode</a> on <var>object</var>.

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

<p>Set <var>replayable</var> to true.

<dt>{{ReadableStream}}
<dd><p>Set <var>stream</var> to <var>object</var>.
</dl>
Expand All @@ -4329,7 +4351,8 @@ typedef (BodyInit or ReadableStream) ResponseBodyInit;</pre>
</ol>

<li><p>Let <var>body</var> be a <a for=/>body</a> whose
<a for=body>stream</a> is <var>stream</var>.
<a for=body>stream</a> is <var>stream</var> and <a for=body>replayable flag</a> is
<var>replayable</var>.

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

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

<pre class=idl>[Constructor(optional ResponseBodyInit? body = null, optional ResponseInit init),
<pre class=idl>[Constructor(optional BodyInit? body = null, optional ResponseInit init),
Exposed=(Window,Worker)]
interface Response {
[NewObject] static Response error();
Expand Down

0 comments on commit 82d0b86

Please sign in to comment.