↧
Answer by Moisés Alexander Salazar Vila for Single instance of reusable...
I suggestprivate HttpClient Client { get { return _Client = _Client ?? GetNewClient(); } }Instead ofprivate HttpClient Client { get { return _Client ?? GetNewClient(); } }
View ArticleAnswer by Jeroen Vannevel for Single instance of reusable HttpClient
You don't need multiple instances. In fact, HttpClient is designed specifically to persist and be used for multiple requests (see: HttpClient.DefaultRequestHeaders).There's already a lot written about...
View ArticleSingle instance of reusable HttpClient
I've got this method and I realize that an instance of HttpClass is going to be created for each call to it. While working seemingly OK, I'm considering moving it out and placing it as a private...
View Article