# CORS error accessing API from javascript application

**URL:** <https://meta.discourse.org/t/cors-error-accessing-api-from-javascript-application/128785>\
**Category:** Development\
**Created:** [September 17, 2019, 12:49pm UTC](https://meta.discourse.org/t/cors-error-accessing-api-from-javascript-application/128785 "2019-09-17T12:49:29Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![tdekoekkoek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tdekoekkoek/32/132035_2.png) [@tdekoekkoek](https://meta.discourse.org/u/tdekoekkoek)\
**Post date:** [September 17, 2019, 12:49pm UTC](https://meta.discourse.org/t/cors-error-accessing-api-from-javascript-application/128785/1 "2019-09-17T12:49:29Z")

</div>

This would be a good answer for me except that I cannot get header based auth to work so I am attempting to do it with forms and am also getting CSRF. Any solution? I am trying to create a new topic using the API.

---

_[View the full topic](https://meta.discourse.org/t/cors-error-accessing-api-from-javascript-application/128785)._
