I have two URLs:
One is the application URL = http://domain.com/app
One is the application API URL = http://api.domain.com/
How can I get the application to be able to request things from the api at a different subdomain.
I have already tried putting Access-Control-Allow-Origin: * on both sides with no luck.
Thanks
The two servers (not the client) need to send the following headers:
You could inspect the headers returned from the server (using Firebug or others) if the servers are supporting cross origin resource sharing.
If you can’t modify the two servers to add the headers, one other possibility to set up a proxy that sit between your request and two servers. This proxy could add the headers if you need to access them
If you own admin right to the servers, this CORS page shows how to add the headers in various platforms.