私はhttpRequestObject
として送信する必要があるフォームのASP.NET MVCプロジェクトを持っています。私は数日前に簡単にしようとしていますXMLhttp
サードパーティのクレジットカード会社のURLをクリアしてリダイレクトをXML形式で返信する - 私はiframe
またはポップアップによってインターネット上でチェックされたリダイレクトソリューションの場合第三者へのhttpリクエストの投稿とリダイレクトの応答
ここではすべて解決策を確認しましたが、何も問題ありません。私がプロキシやファイアウォールのような方法でブロックされているかどうかをチェックし、問題ではない。
私もAJAXを試してみました -
function createMPITransaction() {
var terminal_id = "0962832";
var merchant_id = "938";
var user = "user";
var password = "password";
var url="https://cguat2.creditguard.co.il/xpo/Relay";
var xmlStr = "xml data"
var data = xmlStr;
$.ajax({
type: "POST",
dataType: 'XML',
data: data,
url: url,
username: user,
password: password,
crossDomain: true,
xhrFields: {
withCredentials: true
}
})
.done(function(data) {
console.log("done");
alert(xhr.responseText);
alert(textStatus);
})
.fail(function(xhr, textStatus, errorThrown) {
alert(xhr.responseText);
alert(textStatus);
});
alert(data);
}
私はコンソールに乗る -
のXMLHttpRequestをロードすることはできません "URL" いいえ「アクセス制御 - 許可 - 起源' ヘッダーが要求されたリソースに存在します。 Origin 'http://localhost' はアクセスできません。
クロムのネットワークタブの場合は、XHR
のヘッダーとフォームデータは表示されますが、応答はありません。
助けてくださいか?
これらは参考になります:http://stackoverflow.com/questions/10636611/how-does-access-control-allow-origin-header-workまたはhttp://stackoverflow.com/questions/298745/how-do -i-send-a-cross-domain-post-request-javascriptまたはhttp://stackoverflow.com/questions/199099/how-to-manage-a-redirect-request-after-a-jquery-ajax -call – Ravimallya
またはこれを試すことができます:http://stackoverflow.com/questions/20035101/no-access-control-allow-origin-header-is-present-on-the-requested-resource –