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 Answer
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.
The Fitbit Web API supports CORS. Here's it working in a quick test I just did.
Best Answer
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.
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.
Did your preflight request properly set a `referer` header?
Best AnswerYes, it had the correct referrer. I managed to solve by adding some headers to my .htaccess! Thanks for your time though 🙂
Best AnswerSure, 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 AnswerJust 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