I'm posting data from our main server (www.mysite.com) to a page on another server (xyz.mysite.com). I can perform a GET call just fine but when doing a POST I get this error:
XMLHttpRequest cannot load http://xyz.oldi.com/mypage.aspx. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.mysite.com' is therefore not allowed access.
The HttpRequest is setup like this:
req.open('post', url, true);
req.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
And I add a header in ASP like this:
Response.AddHeader("Access-Control-Allow-Origin", "*");
But I'm still getting the origin error. What components could I be missing? Thanks!