Microsoft recommends using IHttpClientFactory instead of either create a new HttpClient for each use (potential socket starvation even if disposing correctly), or reusing same client yourself (DNS updat issues).
This is available since .net core 2.1 but not in any net standard version.
Could/should this be included in 2.1? Some libraries may want to take it on as a constructor arg
@davidsh @glennc @shirhatti any thoughts on this?
IMO, IHttpClientFactory is far too opinionated to be part of the .NET Standard.
IHttpClientFactory ships as part of Microsoft.Extensions.Http package which is a NETStandard2.0 package. If libraries want to use it, they are free to use the package reference.
Makes sense.
Most helpful comment
IMO,
IHttpClientFactoryis far too opinionated to be part of the .NET Standard.IHttpClientFactoryships as part ofMicrosoft.Extensions.Httppackage which is a NETStandard2.0 package. If libraries want to use it, they are free to use the package reference.