"jsonp" を使用する jQuery AJAX GET リクエストに Accept ヘッダーを追加しようとしていますdataType
が、何らかの理由で機能しません。これまでの私のコードは次のとおりです。
var e4json = JSON.stringify( {
"thomas_smith106" : "Daniel244",
"transaction_type" : "34",
"transaction_tag" : "902006933",
"authorization_num" : "ET4653",
"amount" : "15.75"
} );
$.ajax ({
url: "https://api.demo.globalgatewaye4.firstdata.com",
type: "GET",
headers : {
'accepts' : 'application/json'
},
data: e4json,
dataType: "jsonp",
success: function (response) {
alert('Successfuly called the e4 gateway api');
}
});
複数のことを試しましたが、何も機能していないようです。jQueryサイトのドキュメントを見ましたが、適切な例が見つかりません。
これは、リクエストヘッダーに対して得られるものです。Accept ヘッダーを「application/json」にする必要があります。
Accept:*/*
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Cookie:_fd_session=d69310c5cd4a02a4700b5ba63f0d0c9b
Host:api.demo.globalgatewaye4.firstdata.com
Referer:http://localhost:8080/smart-two-site/customerinfo.html
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36
どんな助けでも素晴らしいでしょう。ありがとう!