Рет қаралды 56,048
Get the source code for this video for FREE → the-dotnet-wee...
☄️ Master the Modular Monolith Architecture: bit.ly/3SXlzSt
📌 Accelerate your Clean Architecture skills: bit.ly/3PupkOJ
🚀 Support me on Patreon to access the source code: / 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
www.milanjovan...
Join my weekly .NET newsletter:
www.milanjovan...
Read my Blog here:
www.milanjovan...
Subscribe for more:
/ @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