undici
undici copied to clipboard
Spec Deviations
I think it would be good if we could agree on long term and short term spec deviations. Maybe base it on: https://deno.land/manual/runtime/web_platform_apis#spec-deviations?
@AlttiRi @mcollina @benjamingr @nodejs/undici @nodejs/http
Not sure what cloudflare does? @jasnell
It looks that all Fetch API specs are actually Fetch API specs mixed with "Browser requests behaviour specs".
The great example is "Fetch Metadata Request Headers" spec, which actually is about every request in browsers, not only made with fetch
function.
My opinion that "pure" Fetch API is about fetch, fetchInit, Headers, Request, Response, ReadableStream.
I want fetch
in Node.js since I want to use for network requests the convenient, well know API, which I always use in browsers.
As from a Node.js library I expect that it will give me more control than browser's fetch
, the example — a custom headers order. Custom set of default headers. What if someone want to set only 4 headers, as is Deno's fetch
does (accept
, user-agent
, accept-encoding
, host
)?
Extending also looks acceptable, currently Request.body
is "async iterable", while the native fetch is not. (In fact it can be done with 10 lines of code for the native fetch
.)