# CORS (Access-Control-Allow-Origin) error while using RASA HTTP API, RASA version == 1.1.6

**URL:** <https://forum.rasa.com/t/cors-access-control-allow-origin-error-while-using-rasa-http-api-rasa-version-1-1-6/14600>\
**Category:** Rasa Open Source\
**Created:** [August 21, 2019, 7:49am UTC](https://forum.rasa.com/t/cors-access-control-allow-origin-error-while-using-rasa-http-api-rasa-version-1-1-6/14600 "2019-08-21T07:49:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vermadev54](https://avatars.discourse-cdn.com/v4/letter/v/977dab/32.png) [@vermadev54](https://forum.rasa.com/u/vermadev54)\
**Post date:** [August 21, 2019, 7:49am UTC](https://forum.rasa.com/t/cors-access-control-allow-origin-error-while-using-rasa-http-api-rasa-version-1-1-6/14600/1 "2019-08-21T07:49:12Z")

</div>

Using ajax call to my local RASA server. I am using RASA version 1.1.6. RASA installed in Windows server.

Local RASA server started with command -

rasa run -p 7500 --enable-api -m models --credentials socket\_credentials.yml --endpoints endpoints.yml --cors ‘\*’

Also some time I am using following command to run RASA model -

rasa run -p 7500 --enable-api -m models --credentials socket\_credentials.yml --endpoints endpoints.yml --cors Access-Control-Allow-Origin

Error I am getting:

Access to XMLHttpRequest at -

‘[http://10.132.210.25/conversations/f7f36d0f87874e6e9a2cf56932da61aa/tracker?include\_events=Applied](http://10.132.210.25/conversations/f7f36d0f87874e6e9a2cf56932da61aa/tracker?include_events=Applied)’ from origin ‘null’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Requesting your help and guidance on the above issue.

---

<div class="post-metadata">

**Author:** ![kabeer](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/kabeer/32/5310_2.png) [@kabeer](https://forum.rasa.com/u/kabeer)\
**Post date:** [September 17, 2019, 9:45am UTC](https://forum.rasa.com/t/cors-access-control-allow-origin-error-while-using-rasa-http-api-rasa-version-1-1-6/14600/2 "2019-09-17T09:45:52Z")

</div>

Have you got the solution? I am facing same problem.

---

<div class="post-metadata">

**Author:** ![msamogh](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/msamogh/32/3478_2.png) [@msamogh](https://forum.rasa.com/u/msamogh)\
**Post date:** [September 26, 2019, 11:38am UTC](https://forum.rasa.com/t/cors-access-control-allow-origin-error-while-using-rasa-http-api-rasa-version-1-1-6/14600/3 "2019-09-26T11:38:48Z")

</div>

Could you upgrade to the latest Rasa version and try again?

---

<div class="post-metadata">

**Author:** ![kabeer](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/kabeer/32/5310_2.png) [@kabeer](https://forum.rasa.com/u/kabeer)\
**Post date:** [September 27, 2019, 4:58am UTC](https://forum.rasa.com/t/cors-access-control-allow-origin-error-while-using-rasa-http-api-rasa-version-1-1-6/14600/4 "2019-09-27T04:58:08Z")

</div>

Hi @vermadev54, I resolved that error by replacing the port in ajax call. I replaced the port 5055 with 5005, then it works.

---

<div class="post-metadata">

**Author:** ![johanepic](https://avatars.discourse-cdn.com/v4/letter/j/aca169/32.png) [@johanepic](https://forum.rasa.com/u/johanepic)\
**Post date:** [September 21, 2021, 1:44pm UTC](https://forum.rasa.com/t/cors-access-control-allow-origin-error-while-using-rasa-http-api-rasa-version-1-1-6/14600/5 "2021-09-21T13:44:44Z")

</div>

This is happening because of the CORS (Cross Origin Resource Sharing) . For every HTTP request to a domain, the browser attaches any HTTP cookies associated with that domain. This is especially useful for authentication, and setting sessions. You are doing an XMLHttpRequest to a different domain than your page is on. So the browser is blocking it as it usually allows a request in the same origin for security reasons. You need to do something different when you want to do a cross-domain request.

JSONP ( JSON with Padding ) is a method commonly used to bypass the cross-domain policies in web browsers. You’re on domain [example.com](http://example.com) , and you want to make a request to domain example.nett . To do so, you need to cross domain boundaries. JSONP is really a simple trick to overcome the XMLHttpRequest same domain policy. So, instead of using XMLHttpRequest we have to use \< script \> HTML tags, the ones you usually use to load JavaScript files , in order for [JavaScript](http://net-informations.com/js/iq/default.htm) to get data from another domain.

**Localhost**

If you need to enable CORS on the server in case of localhost, you need to have the following on request header.

`Access-Control-Allow-Origin: http://localhost:9999`
