Skip to content
0:00 / 0:00

#dotnet#httpclient#httpclientfactory

Stop using the HttpClient the wrong way in .NET

Nick Chapsas

429K subscribers • 62 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • Presented by Nick Chapsas
  • An opinion. It argues one side of a question engineers disagree on.

Intermediate. Assumes working knowledge.

213K views4 years ago2 recommendations

Systems programmingWeb developmentNetworking and protocolsWeb performanceC# and .NET

Nick Chapsas explains why instantiating HttpClient directly can cause port exhaustion and how to use HttpClientFactory to solve it.

Check out my courses: dometrain.com Become a Patreon and get source code access: patreon.com/nickchapsas Hello everybody I'm Nick and in this video I will show you why the way you might be using the HttpClient in .NET could be completely wrong and then follow it up by showing you the right way to implement it. Workshops NDC Oslo | 26 – 30 Sept | bit.ly/ndcoslo2022workshop NDC Sydney | 10 – 14 Oct | bit.ly/ndcsydney2022workshop dotnetdays | 20 – 22 Oct | bit.ly/dotnetdays2022workshop NDC Minnesota | 15 – 18 Nov | bit.ly/ndcminnesota2022workshop NDC London | 23-27 January 2023 | bit.ly/ndclondon2023 Don't forget to comment, like and subscribe :) Social Media: Follow me on GitHub: bit.ly/ChapsasGitHub Follow me on Twitter: bit.ly/ChapsasTwitter Connect on LinkedIn: bit.ly/ChapsasLinkedIn Keep coding merch: keepcoding.shop #csharp #dotnet #nickchapsas

Why it's here

2 people recommend this

What people say. Recommended as a clear explanation of HttpClient pitfalls like port exhaustion and DNS caching in .NET.

u/WestDiscGolfin r/dotnet • Recommends

On “consuming api in a proper way”

You should look at using httpclientfactory and httpclient to aid with avoiding issues such as DNS caching and port exhaustion. This blog post about it could help (disclosure it's mine) - https://adamstorr.azurewebsites.net/blog/simple-example-of-calling-rest-api-with-httpclient-in-net5.0 Nick Chapsas has also done a video recently on the subject - link to this video Good luck!

u/Dannyboyngin r/dotnet • Recommends

On “HttpClient best approach”

I like the way Nick Chapsas explains it. link to this video