MADE-Apps / MADE.NET

MADE.NET is a home to all of those bits of code that you know you'll reuse in another project. Making app development easier with .NET.

Home Page:https://made-apps.github.io/MADE.NET/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Docs] Networking documentation suggests poor use of HttpClient

viceroypenguin opened this issue · comments

Current recommended use of HttpClient is defined in this document.

One should not create a new HttpClient for each request, neither should one use a single HttpClient for the entire application. Instead, the DI system should be used to receive an HttpClient, either directly or indirectly, depending on use and configuration.

I have not used MADE.NET, so I do not know the best way to suggest the proper use of HttpClient, but documentation should be updated to reflect modern recommended practices.

Thanks for bringing this to my attention 👍🏻

I'll look into improving the documentation for MADE to reflect usage with the HttpClientFactory approach 😄

It should be relatively straight forward. For network requests, you will just pass the client created by the factory. There may be some improvements that can be made to the request manager though to support DI with the factory itself.