Город МОСКОВСКИЙ
00:11:46

The RIGHT Way To Use HttpClient In .NET

Аватар
JavaScript Алгоритмы
Просмотры:
21
Дата загрузки:
29.11.2023 00:17
Длительность:
00:11:46
Категория:
Технологии и интернет

Описание

? Accelerate your Clean Architecture skills: https://bit.ly/3PupkOJ

? Support me on Patreon to access the source code: https://www.patreon.com/milanjovanovic

The easy way to make HTTP requests in .NET is to use the HttpClient to send those requests. And it's a great abstraction to work with, especially with the methods supporting JSON payloads and responses. Unfortunately, it's easy to misuse the HttpClient. Port exhaustion and DNS behavior are some of the most common problems. So in this video, I'll show what you need to know about working with HttpClient correctly.

The Right Way To Use HttpClient In .NET
https://www.milanjovanovic.tech/blog/the-right-way-to-use-httpclient-in-dotnet

Join my weekly .NET newsletter:
https://www.milanjovanovic.tech

Read my Blog here:
https://www.milanjovanovic.tech/blog

Subscribe for more:
https://www.youtube.com/@MilanJovanovicTech

Chapters
0:00 The naive way to use HttpClient
1:10 Why is this a problem?
2:05 Using the IHttpClientFactory
3:34 Adding configurability with named clients
5:54 Strong typing with typed clients
9:17 Why you should avoid typed clients in Singleton services

Рекомендуемые видео