Back to Browse

You Are Using HttpClient Wrong

5.0K views
Jul 18, 2023
9:06

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: https://www.youtube.com/channel/UCyTPru-1gZ7-4qblcKM0TiQ/join 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: https://www.youtube.com/@DanPatrascuTech ✅Instagram: https://www.instagram.com/danpatrascutech/ ✅TikTok: https://www.tiktok.com/@danpatrascutech

Download

1 formats

Video Formats

360pmp414.7 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

You Are Using HttpClient Wrong | NatokHD