2012-02-17 181 views
0

我面对这个问题 405(HTTP GET方法不受此URL支持)错误405(HTTP GET方法不受此URL支持)

,而该方法后在我的代码

$.ajax({ 
      url: myUrl + "?" + "token=" + AccessToken + "&key=" +dev_key, 
      jsonp: 'callback', 
      dataType: 'jsonp', 
      type: 'post', 
      data: sendXML, 
      success: function (result) { 
       alert("hjgh"); 
      } 
     }); 

function callback(json) 
    { 
     alert("ghj"); 
    } 
+1

[ajax POST方法不可用]的可能重复(http://stackoverflow.com/questions/9462994/ajax-post-method-is-not-working) – 2012-03-06 08:56:47

+0

“?” +“token =”可以改写为“?token =” – 2012-03-16 09:22:35

+0

这无关紧要@RobertoAloi – 2012-03-16 10:17:29

回答

0

您将'jsonp'指定为'dataType'。这将导致该方法为'GET',覆盖您的'类型'设置。

相关问题