You Are Using HttpClient Wrong

Опубликовано: 18 Июль 2023
на канале: Codewrinkles
4,171
214

You are probably using the HttpClient wrong in .Net/C#. Why? Well, because the HttpClient implements IDIsposable and we tend to stick to the rule that we should wrap in a using everything that implements IDisposable.Well, that's not true in case of the HttpClient. Wrapping it in a using might even break your app. In this video I show you exactly why this happens and how we can fix it!
#dotnet #csharp

Join this channel to get source code access and other perks:
   / @codewrinkles  

Content:
1. Intro: 00:00
2. Typical HttpClient use: 01:01
3. Socket exhaustion: 02:07
4. Solving the problem: 04:07
5. HttpClient in service classes: 04:55
6. It's always DNS! 07:01

Also follow me here (especially if you are a self taught developer):
✅My other channel:    / @danpatrascutech  
✅Instagram:   / danpatrascutech  
✅TikTok:   / danpatrascutech