friends I am new to Asp.net WebApi, I was trying to send a post request to generate a token from my Google Chrome and it gives me this error.
Access to XMLHttpRequest at 'http://localhost:7068/token' from origin
'http://127.0.0.1:5500' has been blocked by CORS policy: No
'Access-Control-Allow-Origin' header is present on the requested
resource.
I can send a post request to controllers since I have enabled cors in WebApiConfig.cs
here is the code I used to enable cors
EnableCorsAttribute cors = new EnableCorsAttribute("*", "*", "*"); config.EnableCors(cors);
my problem is I cannot generate a token from the WebApi it gives me the above-mentioned error.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…