INTERACT FORUM
Networks and Remotes => Media Network => Topic started by: dkan24 on March 11, 2014, 11:25:27 am
-
I was just checking out the REST API calls, and was happy to see it covers a lot! One thing I was hoping for was CORS headers so we can make API calls directly from a web client in Javascript. Are there any plans to offer this?
Here is a good overview of CORS - https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS (https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS)
Basically, you need to send something like this in the response headers -
Access-Control-Allow-Methods:GET
Access-Control-Allow-Origin:*
and then Javascript can load the XML.
Thanks!
-
In an upcoming build:
SDK: The MCWS web service responses set a CORS "Access-Control-Allow-Origin" header.
We don't currently support OPTIONS requests and therefor don't support so called "preflight requests" as outlined by CORS, but I hope this should be enough for your web client.