CORS Policy with WASM

Balu Raju 81 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

Developer technologies | .NET | Blazor
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.