If you are getting this error message with Web API in Blazor WeAssembly application. You can troubleshoot following ways.
- Take the api end point and trigger with PostMan
- If it is not triggering, then try to see the api method attribute. So many we missed out input parameter of Web api method.
In my case, I was missed out InstanceId for Web API Method
[HttpGet]
[Route("[action]]
public async Task<List<ProductModel>> GetProducts(int instanceId) => await _service.GetProducts(instanceId);
Fix: Pass the instanceId parameter to web api method.
[HttpGet]
[Route("[action]/{instanceId}")]
public async Task<List<ProductModel>> GetProducts(int instanceId) => await _service.GetProducts(instanceId);