Skip to content Skip to sidebar Skip to footer

Ajax 405 (method Not Allowed) Cross Domain Issue

I am trying to run this script from localhost but it gets an error 405 (Method Not Allowed) . Code $(document).ready(function(){ $.ajax({ url:'http://some.url/',

Solution 1:

That has nothing to do with CORS, HTTP 405 means that your HTTP method is not permitted, e.g. GET, POST, etc.

According to Chrome dev tools, only POST and OPTIONS are permitted HTTP methods.

Chrome dev tools response headers

To send a POST request using jQuery.ajax(), use the following:

$.ajax('url', {
    // other settings heretype: 'POST'
}

You can also use the jQuery.post() wrapper method to do the same thing.

Note that the particular site in question has not setup cross-origin support, therefore if you need to access this, you'll need to get the site to fix this issue or you'll need to use your server as a proxy.

Post a Comment for "Ajax 405 (method Not Allowed) Cross Domain Issue"