I use cross-domain $.ajax. When I use GET everything is ok, but when I try to send a POST I have some problem.
$.ajaxSetup({
contentType: "application/json;charset=UTF-8"
});
Then:
$.ajax({
'url': another_domain_url,
'data': data,
'type': 'post',
'crossDomain': true,
...
});
When I use 'type'='get' here — everything is ok. But if I use 'post', I have in Chrome Console:
OPTIONS (my_url) net::ERR_EMPTY_RESPONSE
l.cors.a.crossDomain.send jquery.min.js:4
o.extend.ajax jquery.min.js:4
...
And in the Network tab:
Request Headers CAUTION: Provisional headers are shown.
Access-Control-Request-Headers:accept, content-type
Access-Control-Request-Method:POST
What can I do?