#Why Did the Angular Team Develop `withFetch` Instead of Replacing HttpClient?

3 messages · Page 1 of 1 (latest)

balmy fulcrum
#

Why did the Angular team decide to develop the withFetch function? I assume it leverages the browser's native fetch API rather than the HttpClient's implementation. So, what’s the issue with the regular HttpClient? And if fetch is better, why not make it the default and replace the underlying implementation entirely?

random bough
#

Because imposing fetch to all the people using the previous XmlHttpRequest-based client could have caused a lot of issues. And because the XmlHttpRequest-based implementation supports some features that the fetch implementation doesn't support.

zenith sky
#

HttpClient is a the client part, where Fetch is a HttpBackend implementation. We initially had an XhrBackend but added the FetchBackend to improve SSR support. (Xhr is a browser API not provided by node).