Sure, you could write all those Blazor HTTP calls yourself...

added by DotNetKicks
7/16/2021 8:29:21 AM

626 Views

If you're building a Blazor WASM application you're almost certainly going to wind up making calls to an API. The typical way to do this is to use HttpClient: @using System.Net.Http @using System.Net.Http.Json @using System.Threading.Tasks @inject HttpClient Http @code { private Customer[] customers; protected override async Task OnInitializedAsync() { customers = await Http.GetFromJsonAsync ("api/Customer"); } } This works well, but it does carry a few limitations.


0 comments