# CORS Errors in ionic 6 capacitor

**URL:** <https://forum.ionicframework.com/t/cors-errors-in-ionic-6-capacitor/228171>\
**Category:** Ionic Framework\
**Created:** [November 1, 2022, 6:29am UTC](https://forum.ionicframework.com/t/cors-errors-in-ionic-6-capacitor/228171 "2022-11-01T06:29:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AzeemAhmed](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@AzeemAhmed](https://forum.ionicframework.com/u/AzeemAhmed)\
**Post date:** [November 1, 2022, 6:29am UTC](https://forum.ionicframework.com/t/cors-errors-in-ionic-6-capacitor/228171/1 "2022-11-01T06:29:45Z")

</div>

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

 ![cors image](https://global.discourse-cdn.com/ionicframework/original/3X/7/8/78182eb01b5bcb34e7ca37ef170b9ff78d8ee0cb.png)

---

<div class="post-metadata">

**Author:** ![twestrick](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/twestrick/32/136131_2.png) [@twestrick](https://forum.ionicframework.com/u/twestrick)\
**Post date:** [November 1, 2022, 1:32pm UTC](https://forum.ionicframework.com/t/cors-errors-in-ionic-6-capacitor/228171/2 "2022-11-01T13:32:31Z")

</div>

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`

---

<div class="post-metadata">

**Author:** ![AzeemAhmed](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@AzeemAhmed](https://forum.ionicframework.com/u/AzeemAhmed)\
**Post date:** [November 2, 2022, 8:46am UTC](https://forum.ionicframework.com/t/cors-errors-in-ionic-6-capacitor/228171/3 "2022-11-02T08:46:48Z")

</div>

I am using http in Android but still issue

---

<div class="post-metadata">

**Author:** ![twestrick](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/twestrick/32/136131_2.png) [@twestrick](https://forum.ionicframework.com/u/twestrick)\
**Post date:** [November 2, 2022, 1:10pm UTC](https://forum.ionicframework.com/t/cors-errors-in-ionic-6-capacitor/228171/4 "2022-11-02T13:10:15Z")

</div>

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](https://ionicframework.com/docs/troubleshooting/cors).

---

<div class="post-metadata">

**Author:** ![pramodjnv7](https://avatars.discourse-cdn.com/v4/letter/p/f08c70/32.png) [@pramodjnv7](https://forum.ionicframework.com/u/pramodjnv7)\
**Post date:** [January 12, 2023, 7:44am UTC](https://forum.ionicframework.com/t/cors-errors-in-ionic-6-capacitor/228171/5 "2023-01-12T07:44:11Z")

</div>

I have the same error, can you suggest one?
