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:
Code:
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:
Code:
req.open('post', url, true);
req.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
req.send(data);
And I add a header in ASP like this:
Code:
Response.AddHeader("Access-Control-Allow-Origin", "*");
But I'm still getting the origin error. What components could I be missing? Thanks!