CORS Policy with WASM

Balu Raju 26 Reputation points
2022-06-24T16:16:22.293+00:00

What is the requirement to have Blazor WASM call Web API hosted on the web server.
I have Web API hosted already on the web server which is good with Blazor server app,
Now I have the same service called by Blazor WASM, i get teh following error
"has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled."

what are the steps I need to take to resolve the issue? documentation is very sparse

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
795 questions
{count} votes