سؤال

I am facing this issue 405 (HTTP method GET is not supported by this URL)

whereas the method is post in my code

$.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");
    }
هل كانت مفيدة؟

المحلول

You specified 'jsonp' as your 'dataType'. That will cause the method to be 'GET', overriding your 'type' settings.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top