In ASP.NET we have
Код: Выделить всё
IHttpClientFactoryI need to create various libraries that connect to some API, and they will be used in our ASP.NET Core backend app. But generally, it can be used on any kind of project.
My question is what is the correct way and best practice for using a HTTP client inside a library? Should I create a static one inside the project or should I ask the user of the library to provide their instance, or should I directly ask the
Код: Выделить всё
IHttpClientFactoryNote: this is not an opinion based question. I'm asking for the best practice and the correct one.
Источник: https://stackoverflow.com/questions/781 ... et-library
Мобильная версия