javascript - Trying to make a Cross domain post call in IE9 -
i trying make cross domain post call in ie9 below code:
$.support.cors = true; var data = {"userid":uid,"email":email,"password":password}; if (isie () && isie () <= 9) { $.ajax({ type: 'post', crossdomain: true, url: posturl, cache:false, contenttype: 'application/json; charset=utf-8', datatype: 'jsonp', data:data, jsoncallback:'localjsonpcallback', jsonp:false, success: function (data) { console.log(data); }, error: function (status){ console.log(status); $("#error").html("incorrect e-mail entered. please re-enter e-mail "); } }); } function localjsonpcallback(json) { if (!json.error) { alert("success"); } else { alert(json.message); } }
however, when @ call in fiddler getting 405 error , request header showing get:
get posturl?format=json&userid=123456&email=test%40test.com&password=password1&_=1434232587917 http/1.1
why if making post in request header showing get? doing syntactically wrong call?
your request looks okay , server response you're describing, it's "problem" server, http status code 405 means bad method, i.e. server doesn't allow post
requests. it's still strange translate get
, still think it's because of server implementation, not error on side. try tool curl
, see response headers get, won't if it's server bug/error.
if not have control on server, things remaining contact owner , ask them allow post request or send get
request, although it's bad send non-encoded login data.
Comments
Post a Comment