A typed client is a dedicated service class that wraps an HttpClient and exposes clear operations for a remote API. It keeps URL paths, HTTP verbs, response handling, and other HTTP mechanics out of consuming code. section 33.2.3
ExchangeRatesClient
An ExchangeRatesClient accepts HttpClient through its constructor and exposes GetLatestRates(). The method requests the latest rates, checks for a successful response, and returns the response content. An endpoint can inject the client and call only that method. section 33.2.3
Register and configure the client with IHttpClientFactory:
- Inject the typed client into consuming services or endpoints instead of constructing HTTP requests there. section 33.2.3
