Use HttpClient Properly with HttpClientFactory With Named and Typed Clients in .NET

preview_player
Показать описание

In this video, I will show you how to properly use an HttpClient in your application by using an HttpClientFactory. You will see the advantages of using HttpClientFactory and how it prevents additional problems that HttpClient can cause. Additionally, I will show you how to create named and typed clients using HttpClientFactory.

FOLLOW US ON SOCIAL MEDIA!
Рекомендации по теме
Комментарии
Автор

Thank you all for watching and for your support.

CodeMaze
Автор

Hi Marinko, It's clearly explained and worked as expected. I was looking for something like this for a long time. However, my use case is slightly different. I need to protect my Azure function app instead of my WebApi. Do you have any thoughts?

philipquarles
Автор

Hi Marinko,
is it better to configure your type client using action delegate while registering it or in constructor like you did? You are injecting http client inside CompaniesClient, i assume that is possible to configure base url and timeout inside program.cs while registering CompaniesClient.

Best regards

tbjszhl