INTERACT FORUM

Networks and Remotes => Media Network => Topic started by: dkan24 on March 11, 2014, 11:25:27 am

Title: CORS (Cross Origin Resource Sharing) for developers
Post 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 -

Code: [Select]
Access-Control-Allow-Methods:GET
Access-Control-Allow-Origin:*

and then Javascript can load the XML.

Thanks!
Title: Re: CORS (Cross Origin Resource Sharing) for developers
Post by: Hendrik on April 17, 2014, 09:04:54 am
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.