Recommendations:
- Use IHttpClientFactory for obtaining HttpClient instances (this is important to ensure that DNS is not cached eternally)
- Use a request middleware to set any headers or other options that vary over the course of the application's lifetime (eg, auth headers)
- Avoid modifying any properties on HttpClient after it has been initialized
- Do not cache HttpClient instances in long-lived objects. (eg in class members or DI containers), either use the IHttpClientFactory every time a client is needed, or create short-lived typed clients: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/http-requests?view=aspnetcore-3.1#typed-clients