How To Use HTTP CLIENT IN ASP NET CORE Applications | Getting Started With ASP.NET Core Series



How To Use HTTP CLIENT IN ASP NET CORE Applications | Getting Started With ASP.NET Core Series

How To Use HTTP CLIENT IN ASP NET CORE Applications | Getting Started With ASP.NET Core Series

Hi Friends, The original and well-known HttpClient class can be easily used, but in some cases, it isn’t being properly used by many developers. There are different issues that you can run into when instantiating and using the HttpClient class directly in your application code. You can run into multiple open connections, socket exhaustion, failure
to handle underlying DNS changes, etc. To address all these issues, .NET Core has the IHttpClientFactory interface that can be used to
configure and create HttpClient instances.

In this video, I will walk you through the common mistakes that we run into when creating and managing HttpClient instances ourselves.
I will show how you netstat to inspect the underlying socket connections that are opened when we create HttpClient instances and how the code we write affects it. I will then show you how to fix those using the IHttpClientFactory and the different consumption patterns
available – Basic, Named, and Typed client instances.

🔗Are You Using HttpClient in The Right Way? – https://www.rahulpnath.com/blog/are_you_using_httpclient_in_the_right_way/
🔗HTTP Requests using IHttpClientFactory – https://docs.microsoft.com/en-us/aspnet/core/fundamentals/http-requests?WT.mc_id=AZ-MVP-5003875
🔗Issues with HttpClient – https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests?mvpaWT.mc_id=AZ-MVP-5003875
🔗Netstat – https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/netstat?mvpWT.mc_id=AZ-MVP-5003875
🔗Source Code – https://rahulpnath.visualstudio.com/DefaultCollection/YouTube%20Samples/_git/MakingHttpRequest

Additional Watching
📹Configuration in ASP NET Core – https://www.youtube.com/watch?v=5GlgHV_12-k
📹Dependency Injection in ASP NET Core – https://www.youtube.com/watch?v=YR6HkvNBpX4
📹ASP NET Core Series – https://www.youtube.com/playlist?list=PL59L9XrzUa-nqfCHIKazYMFRKapPNI4sP

Come say hi! ✋
🌍 Blog – https://rahulpnath.com/
✉ Subscribe to my Newsletter – https://www.rahulpnath.com/subscribe
🐦Twitter – https://twitter.com/rahulpnath
📸Instagram – https://www.instagram.com/rahulpnath/

🎥 Recording Setup and Workflow – https://www.rahulpnath.com/blog/youtube_setup_and_workflow/

Make sure to SUBSCRIBE to the channel. THANK YOU for helping me grow this channel !!

Comments are closed.