Closed
Description
First https://github.com/yutakahirano/fetch-with-streams needs to be integrated. So developers can access the stream of request/response. Next is giving them control over the stream.
- What if you do
fetch(url, { body })
where body is a stream which gets random stuff (not bytes) enqueued in it? - Result: when fetch reads from body, it notices a non-
BufferSource
, and ... does what?- Returned promise rejects
- Cancel the stream
- On the wire, it just terminates somehow? How does HTTP work?
- Require "cors-with-forced-preflight" (you need a preflight in most cases anyway, and it's also required for progress events, which streams enable) (in particular you need it for everything that isn't a POST with one of the
<form>
MIME types) - Always do content-encoding: chunked, and do uploads as chunked encoding, which we need to spec in some way