All You Need To Know About IHttpClientFactory in ASP.Net Core
Вставка
- Опубліковано 31 тра 2024
- When it comes to working with the HttpClient in Asp.Net Core, using IHttpClientFactory is the preferred way to go. But what does this even mean? How many approaches do we have to work with the HttpClient in Asp.Net Core? Join me and in this video you'll find everything you need to know about IHttpClientFactory in Asp.Net Core
#dotnet #aspnetcore
Join this channel to get source code access and other perks:
/ @codewrinkles
Mentioned videos:
1. HttpClient challenges: • You Are Using HttpClie...
2. Refit: • The FASTEST Way To Bui...
Content:
1. Intro: 00:00
2. Simple HttpClient: 01:15
3. Named HttpClient: 04:13
4. Typed HttpClient: 06:38
5. Generated HttpClient: 10:51
Also follow me here (especially if you are a self taught developer):
✅My other channel: / @danpatrascutech
✅Facebook: / danpatrascutech
✅Instagram: / danpatrascutech
✅TikTok: / danpatrascutech - Наука та технологія
Your channel is pure gold. Thank you for your effort
Perfect!!
You answered all my questions about httpclient. Thanks a lot. It's great that you mentioned a third-party library (refit). Finally, it would be great if it was the rest client.
Now. It's more clear. Thanks 👍
Amazing, thank you!
Very timely topic! Thank you Dan!
My pleasure!
Great video!! Could you maybe also make a video explaining any pitfalls with regard to the lifecycle of the HttpClient and where (or when) we should update the Api-keys (maybe we have a different api-access key for each logged in user) for each call on the typed HttpClient (i.e. in the program.cs, or in the ctor in client.cs file, or before calling the sendAsync method). I hope my question makes sense : ) Thanks Again!!
I'm not sure exactly what you have in mind. it's true that there might be some potential problems, but on the other hand using IHttpClientFactory solves most of the problems related to using the HttpClient. If you need specific headers for each users than you can add the needed headers in each method method invocation and you pass in the information as parameters or the service can take them from the HttpContext.
Best explanation on youtube
Glad you think so! Thanks for watching
thank you!
thank you
Why in C# to make an API call is such a huge deal...
Hi, thanks for the video. In the part, you talk about typed HttpClient.
How can I add HTTPCLIENTHANDLRE to the HTTPCLINT you injected?
indeed to add certificate /
thanks.
You can configure and add the desired handlers when you register the service.
source code?
here goes one sub from me
Thank you!