Use HttpClient Properly with HttpClientFactory With Named and Typed Clients in .NET

  Рет қаралды 1,840

Code Maze

Code Maze

3 ай бұрын

►► Master Web API development Best Practices: bit.ly/3TnqoFQ
►► Build great web apps in Blazor WebAssembly: bit.ly/437g87T
►► Support us on Patreon and get the source code: / codemaze
In this video, I will show you how to properly use an HttpClient in your application by using an HttpClientFactory. You will see the advantages of using HttpClientFactory and how it prevents additional problems that HttpClient can cause. Additionally, I will show you how to create named and typed clients using HttpClientFactory.
FOLLOW US ON SOCIAL MEDIA!
►► / marinko-spasojevic
►► / codemazeblog
►► / codemazeblog

Пікірлер: 16
@CodeMaze
@CodeMaze 3 ай бұрын
Thank you all for watching and for your support. ►► If you want to master Web API development using best practices, check out our Web API book: bit.ly/3x75ZMM ►► Also, to build great full-stack apps with Blazor, check out our course: bit.ly/3Pw3Y33
@user-hh7cy8tr6h
@user-hh7cy8tr6h 3 ай бұрын
Thx for video!
@CodeMaze
@CodeMaze 3 ай бұрын
My pleasure. Thanks for watching.
@andresbeltran5779
@andresbeltran5779 3 ай бұрын
Excellent 😬😬
@CodeMaze
@CodeMaze 3 ай бұрын
Thank you. Glad you like it.
@StefanLeshi
@StefanLeshi 3 ай бұрын
Great video
@CodeMaze
@CodeMaze 3 ай бұрын
Glad you enjoyed it
@StefanLeshi
@StefanLeshi 3 ай бұрын
@@CodeMaze i was curently workimg with http client and was looking how to optimize it so yeah this video made much easier , keep it up woth videos tnx.
@CodeMaze
@CodeMaze 2 ай бұрын
I am so glad to hear that. Sorry for the late response, didn't see your reply.
@10Totti
@10Totti 3 ай бұрын
Best Tutorial i use Tuyped Clients.
@CodeMaze
@CodeMaze 3 ай бұрын
Thank you very much. Yeah, I also prefer typed clients.
@philipquarles4679
@philipquarles4679 10 күн бұрын
Hi Marinko, It's clearly explained and worked as expected. I was looking for something like this for a long time. However, my use case is slightly different. I need to protect my Azure function app instead of my WebApi. Do you have any thoughts?
@CodeMaze
@CodeMaze 10 күн бұрын
Hi Philip. First of all thanks for the kind words. I didn't work with Azure at all, well I did something small, but nothing more than that, so I hardly can help you with that.
@philipquarles4679
@philipquarles4679 10 күн бұрын
@@CodeMaze Thank you for getting back to me!
@user-tb3js1zh1l
@user-tb3js1zh1l 3 ай бұрын
Hi Marinko, is it better to configure your type client using action delegate while registering it or in constructor like you did? You are injecting http client inside CompaniesClient, i assume that is possible to configure base url and timeout inside program.cs while registering CompaniesClient. Best regards
@CodeMaze
@CodeMaze 3 ай бұрын
Hi. You can configure it inside the Program class, if you search through some of Microsoft's documentation, you will see they have similar examples. But, for me, it is always better to encapsulate that HttpClient configuration inside the typed client class, making the Program class cleaner with less configuration logic. Also, this is configuration strictly related to that specific client, so why not having it inside the typed client's class.
Fix Your Controllers By Refactoring To Minimal APIs
14:56
Milan Jovanović
Рет қаралды 34 М.
5 - Learning how to use IHttpClientFactory | Best Practices | HttpClient C#
16:05
Programming with Felipe Gavilan
Рет қаралды 15 М.
터키아이스크림🇹🇷🍦Turkish ice cream #funny #shorts
00:26
Byungari 병아리언니
Рет қаралды 25 МЛН
Why You Should Always Help Others ❤️
00:40
Alan Chikin Chow
Рет қаралды 136 МЛН
Khóa ly biệt
01:00
Đào Nguyễn Ánh - Hữu Hưng
Рет қаралды 20 МЛН
That's NOT How Async And Await Works in .NET!
12:25
Codewrinkles
Рет қаралды 16 М.
Writing robust integration tests in .NET with WireMock.NET
17:54
Nick Chapsas
Рет қаралды 36 М.
Implementing In-Memory Caching in ASP.NET Core Applications
16:58
Should I Create A Minimal API Or Full API?
7:40
IAmTimCorey
Рет қаралды 33 М.
How to manage user secrets in dot net core
17:56
Study Mash
Рет қаралды 11 М.
What Is .NET Aspire? The Insane Future of .NET!
18:35
Nick Chapsas
Рет қаралды 261 М.
터키아이스크림🇹🇷🍦Turkish ice cream #funny #shorts
00:26
Byungari 병아리언니
Рет қаралды 25 МЛН