How To Use HTTP CLIENT IN ASP NET CORE Applications | Getting Started With ASP.NET Core Series
Rahul Nath
View ChannelAbout
Hey 👋, My name is Rahul, and welcome to my YouTube channel. I am a programmer, blogger, AWS Community Builder, and YouTuber! I love teaching and try to explain 'Why we do What we do' by going deeper into what I teach. Currently, I am working as a Senior Engineer with Oztix in Australia. I make videos on Azure, DevOps, .Net, and React. On the side, I also write blog posts, contribute to Open Source, and do some freelance consulting. I enjoy running and cycling. You can reach me via any of the social media, drop a comment in the videos, or send me an email at [email protected] Thank you for watching, Enjoy!
Latest Posts
Video Description
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 !!
Upgrade Your iPhone Experience
AI-recommended products based on this video

SURPHY Silicone Case Compatible with iPhone 13 Case 6.1 inch (2021), with Camera Protection Liquid Silicone Soft Gel Rubber Phone Case Cover with Microfiber Lining (Pink) Global Recycled Standard

JETech Silicone Case for iPhone 13 6.1-Inch, Silky-Soft Touch Full-Body Protective Phone Case, Shockproof Cover with Microfiber Lining (Black)

GuaGua Case for iPhone 13 6.1 Inch Liquid Silicone Soft Gel Rubber Slim Thin Microfiber Lining Cushion Texture Cover Shockproof Protective Anti-Scratch Phone Case for iPhone 13 2021 Yellow

JETech Case for iPhone 13 Pro 6.1-Inch, Non-Yellowing Shockproof Phone Bumper Cover, Anti-Scratch Clear Back (Clear)

Wireless Charging Case for AirPods Pro 1st / 2nd Gen with Type-C Charging Port, Compatible with AirPod Pro 2nd Generation Replacement Case, with Blue-Tooth Sync Button, No Earbuds

soundcore by Anker P20i True Wireless Earbuds, 10mm Drivers with Big Bass, Bluetooth 5.3, 30H Long Playtime, IPX5 Water-Resistant, 2 Mics for AI Clear Calls, 22 Preset EQs, Customization via App

Anker USB C Charger Cable (6ft 100W, 2Pack), USB 2.0 Type C Fast Charging Cable for iPhone 15 / 15Pro / 15Plus / 15ProMax MacBook Pro 2020, iPad Pro 2020, iPad Air 4, Samsung Galaxy S23+/S23 Ultra ClimatePartner certified

soundcore by Anker Q20i Hybrid Active Noise Cancelling Headphones, Wireless Over-Ear Bluetooth, 40H Long ANC Playtime, Hi-Res Audio, Big Bass, Customize via an App, Transparency Mode, Ideal for Travel

soundcore by Anker Q20i Hybrid Active Noise Cancelling Headphones, Wireless Over-Ear Bluetooth, 40H Long ANC Playtime, Hi-Res Audio, Big Bass, Customize via an App, Transparency Mode, Ideal for Travel
![MRGLAS 2025 Upgraded Magsafe Car Mount Vacuum Suction Magnetic Phone Holder Car, 360° Foldable Adjustable Suction Cup Phone Stand [89+LBS Suction & 2800gf Magnetic] for Car Accessories iPhone17/16](https://m.media-amazon.com/images/I/71UbeT7ccLL._AC_UL960_FMwebp_QL65_.jpg)
MRGLAS 2025 Upgraded Magsafe Car Mount Vacuum Suction Magnetic Phone Holder Car, 360° Foldable Adjustable Suction Cup Phone Stand [89+LBS Suction & 2800gf Magnetic] for Car Accessories iPhone17/16

for Magsafe Car Mount【20 Strong Magnets 】Magnetic Phone Holder for Car Phone Holder Mount Dash【360°】Cell Phone Mount for Car Accessories,Car Mount for iPhone 16 Pro Max 15 14 13 12 Plus MagSafe Cases
![Spigen Spigen Tempered Glass Screen Protector [GlasTR EZ FIT] designed for Nintendo Switch 2 (2025) - 2 Pack](https://m.media-amazon.com/images/I/61L0hIGSbYL._AC_UL1500_FMwebp_QL65_.jpg)
Spigen Spigen Tempered Glass Screen Protector [GlasTR EZ FIT] designed for Nintendo Switch 2 (2025) - 2 Pack
![MRGLAS 2025 Upgraded Magsafe Car Mount Vacuum Suction Magnetic Phone Holder Car, 360° Foldable Adjustable Suction Cup Phone Stand [89+LBS Suction & 2800gf Magnetic] for Car Accessories iPhone17/16](https://m.media-amazon.com/images/I/71UbeT7ccLL._AC_UL960_FMwebp_QL65_.jpg)
MRGLAS 2025 Upgraded Magsafe Car Mount Vacuum Suction Magnetic Phone Holder Car, 360° Foldable Adjustable Suction Cup Phone Stand [89+LBS Suction & 2800gf Magnetic] for Car Accessories iPhone17/16

OHLPRO Tablet Car Mount Universal Tablet Holder for Car Windshield Dash Dashboard, 360 Degree Rotation,TPU Suction Gel Stick, for iPad Mini 4/3/2/1Samsung Galaxy Size 7"- 10.5" Tablet Mount

Magnetic Car Mount Air Vent Cell Phone Holder, Universal Vehicle Dash Dashboard Ac Airvent Cellphone Magic Stand with Clip Hook, for iPhone 16 15 Samsung Lenovo Google etc

AINOPE Phone Holder for Car Vent 2025 Gravity Air Vent Car Phone Holder Mount for iPhone 16 Pro Max with Vent Clip Hand Free Cell Phone Car Mount for iPhone 16 Plus Samsung S25 Ultra Car Accesorries

soundcore by Anker Q20i Hybrid Active Noise Cancelling Headphones, Wireless Over-Ear Bluetooth, 40H Long ANC Playtime, Hi-Res Audio, Big Bass, Customize via an App, Transparency Mode, Ideal for Travel

soundcore by Anker Q20i Hybrid Active Noise Cancelling Headphones, Wireless Over-Ear Bluetooth, 40H Long ANC Playtime, Hi-Res Audio, Big Bass, Customize via an App, Transparency Mode, Ideal for Travel

soundcore by Anker Q20i Hybrid Active Noise Cancelling Headphones, Wireless Over-Ear Bluetooth, 40H Long ANC Playtime, Hi-Res Audio, Big Bass, Customize via an App, Transparency Mode, Ideal for Travel

soundcore by Anker P20i True Wireless Earbuds, 10mm Drivers with Big Bass, Bluetooth 5.3, 30H Long Playtime, IPX5 Water-Resistant, 2 Mics for AI Clear Calls, 22 Preset EQs, Customization via App

SanDisk 64GB 2-Pack Ultra USB 3.0 Flash Drive (2x64GB) - SDCZ48-064G-GAM462, Black

SanDisk Ultra Flair USB 3.0 64GB Flash Drive High Performance up to 150MB/s (SDCZ73-064G-G46)

SanDisk 32GB 3-Pack Cruzer Glide USB 2.0 Flash Drive (3x32GB) - SDCZ60-032G-G46T, Black

SanDisk 32GB Ultra Dual Drive Go USB Type-C Flash Drive, Black -SDDDC3-032G-GAM46
![iPhone Charger Fast Charging [Apple MFi Certified] USB C to Lightning Cable 6FT USBC to Lightning Cable Nylon Braided Type C Cord for iPhone 14 13 12 11 Pro Max XR XS X 8 7 6 Plus SE, iPad](https://m.media-amazon.com/images/I/517jTqwo1nL._AC_UL960_FMwebp_QL65_.jpg)
iPhone Charger Fast Charging [Apple MFi Certified] USB C to Lightning Cable 6FT USBC to Lightning Cable Nylon Braided Type C Cord for iPhone 14 13 12 11 Pro Max XR XS X 8 7 6 Plus SE, iPad

Spigen Case for iPhone 15, iPhone 14, and iPhone 13, Ultra Hybrid MagFit Designed for Apple iPhone 15/14/13 - Crystal Clear

Spigen Thin Fit MagFit Compatible with iPhone 17 Pro Case - Black ClimatePartner certified
![Spigen Case for iPhone 17 Case, Ultra Hybrid MagFit [Anti-Yellowing, Magsafe Compatible] Designed for Apple iPhone 17 Case (2025) - Clear White ClimatePartner certified](https://m.media-amazon.com/images/I/61gT1WljYwL._AC_UL960_FMwebp_QL65_.jpg)
Spigen Case for iPhone 17 Case, Ultra Hybrid MagFit [Anti-Yellowing, Magsafe Compatible] Designed for Apple iPhone 17 Case (2025) - Clear White ClimatePartner certified

Spigen Case for iPhone 17 Case, Liquid Air Designed for Apple iPhone 17 Case (2025) - Matte Black ClimatePartner certified

4-in-1 Wireless Magnetic Power Bank 10800mAh Portable Charger with iWatch Charger, QC4.0+20W PD Fast Charging USB C Battery Pack for Magsafe, iPhone 16/15/14/13/12 Series, Apple Watch etc. (White)




