Lightweight Fetch implementation transparently supporting both HTTP/1(.1) and HTTP/2.
- supports reasonable subset of the standard Fetch specification
- Transparent handling of HTTP/1(.1) and HTTP/2 connections
- Support
gzip/deflate/br
content encoding - HTTP/2 request and response multiplexing support
- HTTP/2 Server Push support
- overridable User-Agent
- low-level HTTP/1.* agent/connect options support (e.g.
keepAlive
,rejectUnauthorized
)
For troubleshooting and debugging, you can enable low-level debug console output from Node.js
(NODE_DEBUG=<module list>
) and/or from poly-fetch
(DEBUG=poly-fetch*
), for example:
NODE_DEBUG=http*,tls DEBUG=poly-fetch* node myTest.js
Thanks to node-fetch and whatwg-fetch for providing a solid implementation reference.