Add Accept header to JQuery AJAX GET (via JSONP) request -


i'm trying add accept header jquery ajax request uses "jsonp" datatype, reason it's not working. here's code far.

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 e4 gateway api');     } }); 

i've tried multiple things nothing seems working. looked @ the documentation on jquery site, i'm not able find examples.

this request headers. need accept header '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, gecko) chrome/33.0.1750.152 safari/537.36 

any awesome. thanks!

unfortunately, it not possible set headers on jsonp request. jsonp request done adding <script> tag website, browser loads other script. see explanation of jsonp.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -