I have an ASP.NET Web API project with .NET 4.8, for accepting requests from any origin, I added these lines to the web.config:
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="*" />
<add name="Access-Control-Allow-Methods" value="*"/>
When I send request by axios in React, I don't have any problem for GET request, but for POST request I have this error:
Access to fetch at 'API URL' from origin 'http://localhost:5173' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.