Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

HttpClient in Blazor WebAssembly Standalone

$
0
0

When I create a new Blazor WebAssembly Standalone project, it automatically adds an HttpClient in Program.cs -- see below:

builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });

Is this necessary and used by the WebAssembly app or is it Microsoft's way of "making my life easier"?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>