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
  • Наука та технологія

КОМЕНТАРІ • 19

  • @adam-xt8te
    @adam-xt8te Місяць тому

    Your channel is pure gold. Thank you for your effort

  • @ahmet9424
    @ahmet9424 9 місяців тому

    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.

  • @koushiksaha8198
    @koushiksaha8198 8 місяців тому +1

    Now. It's more clear. Thanks 👍

  • @hujintao6862
    @hujintao6862 7 місяців тому

    Amazing, thank you!

  • @anonymoos
    @anonymoos 10 місяців тому

    Very timely topic! Thank you Dan!

  • @AM-rl8lv
    @AM-rl8lv 10 місяців тому +2

    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!!

    • @Codewrinkles
      @Codewrinkles  10 місяців тому

      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.

  • @kudasol
    @kudasol 4 місяці тому

    Best explanation on youtube

    • @Codewrinkles
      @Codewrinkles  4 місяці тому

      Glad you think so! Thanks for watching

  • @timur2887
    @timur2887 5 місяців тому

    thank you!

  • @thelastninja4825
    @thelastninja4825 3 місяці тому

    thank you

  • @kirillzlobin7135
    @kirillzlobin7135 Місяць тому

    Why in C# to make an API call is such a huge deal...

  • @alexmel8448
    @alexmel8448 10 місяців тому

    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.

    • @Codewrinkles
      @Codewrinkles  10 місяців тому

      You can configure and add the desired handlers when you register the service.

  • @lxhan893
    @lxhan893 4 місяці тому

    source code?

  • @PrashantUnity
    @PrashantUnity 10 місяців тому +1

    here goes one sub from me