Mozilla自身の仕様では、単純であるGET
か、POST
プリフライトなしでネイティブにCORSである必要がありますが、これまでのところ、POST
私が行ったすべての試みの結果、OPTIONS
ヘッダーが消えてしまいました。コードを取得するために変更するとPOST
、すぐに適切なGET
リクエストが送信されるため、クロスサイト部分は正常に機能します。
これが私がFirefoxでやっていることのスリム化されたサンプルです:
var destinationUrl = 'http://imaginarydevelopment.com/postURL';
var invocation = new XMLHttpRequest();
if (invocation) {
invocation.open('POST', destinationUrl, true);
//tried with and without this line
//invocation.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
invocation.onreadystatechange = (function Handler() {
if (invocation.readyState == 4)
alert('Request made');
});
invocation.send(/* tried with and without data*/);
}
これが私がすでにchromeとIEで働いていたものです:
var destinationUrl = 'http://imaginarydevelopment.com/postURL';
var destination = { url: destinationUrl, type: 'POST', success: AjaxSuccess, error: AjaxError,
dataType: 'text', contentType: 'application/x-www-form-urlencoded'
};
destination.data = { 'rows': rowList, 'token': token };
$jq.ajax(destination);