Skip to main content

Posts

Showing posts with the label Blazor3.0

Different HttpClient Techniques To Consume API Call's In Blazor WebAssembly

  In .Net Core applications, HttpClient instance should be managed by HttpClienFactory with the support of Dependency Injection(DI). Blazor Assembly applications also have those capabilities to use the  HttpClient object in an efficient manner. The techniques provided by the .Net  framework are: Register HttpClient Object Explicitly In DI(Dependency Injection Service) Named Client Type Client HttpRequestMessage Object In this article, we are going to implement Get API call with the above techniques mentioned using a sample Blazor WebAssembly application. Create Blazor WebAssembly Sample App: To follow up on the steps let's begin by creating a sample Blazor WebAssembly application. Use any of the editors of your choice most recommended are like VisualStudio 2019(Support .Net 3.0 plus) or  Visual Studio Code . Third-Party Rest API: To show sample implementation of the Blazor WebAssembly application here I'm going to use external free Rest API for our demos - "https://jsonpl