# CORS Error?

**URL:** <https://forum.ionicframework.com/t/cors-error/24996>\
**Category:** ionic-v1\
**Created:** [May 17, 2015, 11:01am UTC](https://forum.ionicframework.com/t/cors-error/24996 "2015-05-17T11:01:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![beefman](https://avatars.discourse-cdn.com/v4/letter/b/439d5e/32.png) [@beefman](https://forum.ionicframework.com/u/beefman)\
**Post date:** [May 17, 2015, 11:01am UTC](https://forum.ionicframework.com/t/cors-error/24996/1 "2015-05-17T11:01:42Z")

</div>

Hi guys,  
I’m trying to do a HTTP.get but when i click the button to get the information from the webhost i get this error:

```
XMLHttpRequest cannot load http://www.wikicode.co.uk/announcement?date=value2&message=value3&name=value1. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access.

```

Does anybody know how to fix this without setting up a proxy or does anybody know webhosts which support CORS??

When i run this on my android phone i still get an error.

Thanks

---

<div class="post-metadata">

**Author:** ![motiurion](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/motiurion/32/81360_2.png) [@motiurion](https://forum.ionicframework.com/u/motiurion)\
**Post date:** [May 17, 2015, 11:58am UTC](https://forum.ionicframework.com/t/cors-error/24996/2 "2015-05-17T11:58:59Z")

</div>

Add this to server code:

header(‘Access-Control-Allow-Origin: \*’);

Can check this:  
[http://www.html5rocks.com/en/tutorials/cors/](http://www.html5rocks.com/en/tutorials/cors/)  
[http://www.html5rocks.com/en/tutorials/cors/#toc-adding-cors-support-to-the-server](http://www.html5rocks.com/en/tutorials/cors/#toc-adding-cors-support-to-the-server)

> **[Ionic Services Docs](http://legacy-cloud-docs.ionic.io)**
>
> Documentation for the Ionic Services Service: Push, Users, Package, and Deploy

---

<div class="post-metadata">

**Author:** ![beefman](https://avatars.discourse-cdn.com/v4/letter/b/439d5e/32.png) [@beefman](https://forum.ionicframework.com/u/beefman)\
**Post date:** [May 17, 2015, 3:50pm UTC](https://forum.ionicframework.com/t/cors-error/24996/3 "2015-05-17T15:50:58Z")

</div>

Where do i add it? What file and what location?
