Angular · Middle · Question 57 of 75
What does provideHttpClient(withFetch()) change?
- ✓Correct answer:
HttpClientuses the Fetch API instead ofXMLHttpRequest- recommended for SSR - 2It replaces
HttpClientwith globalfetchcalls in components - 3It caches every GET request
Explanation
The API of HttpClient stays the same. Fetch works natively in Node.js, which is why it's preferred on the server.