I am used to registering the httpclient in the program.cs of the client project as follows
builder.Services.AddHttpClient("My.ServerAPI", client => client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)) .AddHttpMessageHandler<BaseAddressAuthorizationMessageHandler>();However this does not work in Blazor .net8. I get errors saying that there is
InvalidOperationException: Cannot provide a value for property 'Http'on type 'My.Client.Pages.RiskReview'. There is noregistered service of type 'System.Net.Http.HttpClient'.
What do I need to do to register the httpclient in blazor .net 8?
I am using webassembly rendering