03-30-2016 14:06
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

03-30-2016 14:06
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi. I'm making calls to Fitbit and have only tested in Chrome this far. I recieve:
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource...
I was reading in this post that Fitbit is supporting CORS but it doesn't seem like it, am I wrong?
Thanks
Daniel
Answered! Go to the Best Answer.

Accepted Solutions
03-30-2016 14:53
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



03-30-2016 14:53
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
The Fitbit Web API supports CORS. Here's it working in a quick test I just did.

03-30-2016 14:53
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



03-30-2016 14:53
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
The Fitbit Web API supports CORS. Here's it working in a quick test I just did.

03-30-2016 14:55
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



03-30-2016 14:55
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Did your preflight request properly set a `referer` header?

03-31-2016 00:23
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

03-31-2016 00:23
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Yes, it had the correct referrer. I managed to solve by adding some headers to my .htaccess! Thanks for your time though 🙂

06-02-2016 10:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

06-02-2016 10:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Could you post what headers you added to .htaccess? Thanks!

06-04-2016 11:26
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

06-04-2016 11:26
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Sure, what worked for me was adding this:
<IfModule mod_headers.c>
#Header add Access-Control-Allow-Origin "http://mydomain.com"
#Header set Access-Control-Allow-Origin "*"
#Header set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE"
#Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept"
</IfModule>

06-12-2016 00:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

06-12-2016 00:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Just this work for me
<IfModule mod_headers.c>
Header add Access-Control-Allow-Origin "*"
</IfModule>
And checkout this guide for Cross Origin Access Header, very good explaination on how it works

