Closed shogedal closed 2 years ago
no idea, never used Blazor.
It seems like it is the same as ASP.Net Core. Although I am still working with IIS Express (built into Visual Studio 2022) I got a clue from https://stackoverflow.com/questions/33014188/httpclient-never-sends-request-on-iis to add this just before the PostAsync: httpRequestMessage.Headers.Add("host", httpRequestMessage.RequestUri.Host); and it works like a charm.
I adding it to the new version i working on so its maybe works better.
I have now updated the code and the NuGet package version 2.0 is on the way, Microsoft doing stuff with the package before it come available public but the code is in this repository from now. The latest code has split the different functions to different classes so example eCommerceClient is the new C# class to use for e-commerce functionality and all of the clients has now the host header set before the PostAsync function being called.
Do you suppose it is because the HttpClient is not created from an HttpClientFactory?