Re: [whatwg/fetch] Add timeout option (#20)

@Mouvedia As the spec [clearly shows (in step 14)](https://fetch.spec.whatwg.org/#main-fetch), XHR will wait for both the headers *and the body* to complete. The timeout for XHR includes the body. Please read the spec more carefully.

> XHR has readystate 3 which corresponds to HEADERS_RECEIVED. We gotta strive for parity with XHR.

The `load` event will only fire when the body has been received. The timeout cares about the load event, not readystate.

XHR is not the same as `fetch`. XHR *always* retrieves the body, whereas `fetch` lets you choose whether to retrieve the body or not. That's why `fetch` needs to have a choice whether the timeout includes the body or not.

----

@jokeyrhyme That's a good point, that complicates the timeout even more. Which is another argument for having this in user-land, so that way the user has full control, rather than adding in several options to `fetch`.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/20#issuecomment-541362559

Received on Saturday, 12 October 2019 21:23:03 UTC