CORS Errors in ionic 6 capacitor

I am facing CORS issue when i hit api … Please Help me

By default, a Capacitor app runs at the following URLs. They need to be added as allowed origins on your API server.

  • iOS: capacitor://localhost
  • Android: http://localhost

I am using http in Android but still issue

What is the exact error in the console? What are the response headers? Do you see an OPTIONS request (should show something like “POST + Preflight” in the Network tab in Chrome, Preflight is a link to the OPTIONS request)?

This is a good resource too - CORS Errors: Cross-Origin Resource Sharing - Ionic Documentation.