Skip to content

Commit

Permalink
Fixing #2.
Browse files Browse the repository at this point in the history
  • Loading branch information
yutakahirano committed Oct 31, 2014
1 parent ed9dc06 commit f4609c9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,15 @@ The __write end__ of a body is the writable stream of the body. It is of type Wr
## [Body mixin](https://fetch.spec.whatwg.org/#body-mixin)

```
dictionary BodyStreamInit {
ReadableStream stream;
};
callback BodyStreamInit = void (WritableStream);
typedef (Blob or BufferSource or FormData or URLSearchParams or USVString or BodyStreamInit) BodyInit;
```

To extract a byte stream and a 'Content-Type' value from a BodyStreamInit object, run these steps:

1. Let _stream_ be an empty byte stream.
2. Let _Content-Type_ be null.
3. Call [[pipeTo]] of object's _stream_ attribute with the __write end__ of the body. Rethrow any exception.
3. Call _object_ with the _write end_ of the body. Rethrow any exception.
4. Return _stream_ and _Content-Type_.

```
Expand Down

2 comments on commit f4609c9

@domenic
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in w3c/ServiceWorker#413 we kind of wanted a separate bodyWriter option instead of reusing body. It is a bit weird to have body: { ...some_json... } or body: "... some string ..." in some places and then body: function (bodyWritableStream) { ... } in others.

@domenic
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do a pull request for what I am thinking so we can have something more concrete to discuss. Will give that a try after breakfast.

Please sign in to comment.