03-30-2016 14:06
03-30-2016 14:06
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.
Best Answer03-30-2016 14:53
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
03-30-2016 14:53
The Fitbit Web API supports CORS. Here's it working in a quick test I just did.
Best Answer03-30-2016 14:53
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
03-30-2016 14:53
The Fitbit Web API supports CORS. Here's it working in a quick test I just did.
Best Answer03-30-2016 14:55
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
03-30-2016 14:55
Did your preflight request properly set a `referer` header?
Best Answer03-31-2016 00:23
03-31-2016 00:23
Yes, it had the correct referrer. I managed to solve by adding some headers to my .htaccess! Thanks for your time though 🙂
Best Answer06-02-2016 10:45
06-02-2016 10:45
Could you post what headers you added to .htaccess? Thanks!
Best Answer06-04-2016 11:26
06-04-2016 11:26
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>
Best Answer06-12-2016 00:44
06-12-2016 00:44
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
Best Answer