Question is a bit too old to answer, but I am posting this for any future reference to this question.
Yes, first setup your server to respond to cors origin OPTIONS request. with 200 ok response.
how it works : The Browser send OPTIONS request before the actual request to confirm that the server is ready to respond to the actual request. if the server is configured to allow CORS Origin request then the actual request is send to the server. otherwise request is not sending to the server.
You can setup your server to allow CORS Origin in different ways. the easy way is : in index.php at the top add the following.
header("Access-Control-Allow-Origin: yoursite1.com , yoursite2.com"); //"Access-Control-Allow-Origin: * " For all Domains header("Access-Control-Allow-Methods: GET, POST, PUT, OPTIONS"); //"Access-Control-Allow-Methods: * " For all Methods header("Access-Control-Allow-Headers: Content-Type"); //"Access-Control-Allow-Headers: OR *" For all Headers
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') { return $response->withStatus(200); }
