OData と Knockout Js を使用しているアプリケーションがあります。私のアプリケーションでは、POST、GET、および DELETE HTTP 動詞を使用しています。アプリケーションをホストしたときに、GET と POST はエラーをスローしませんが、DELETE はエラーをスローし、修正方法がわかりません。
以下は、DELETEを使用している場所です
self.remove = function (canadiancrude) {
var conf = confirm("Are you sure you want to delete this record?");
if (conf == true) {
$.ajax({
url: '/odata/Canadiancrudes(' + canadiancrude.Id + ')',
type: 'DELETE',
contentType: 'application/json',
dataType: 'json'
});
}
}
そして、エラーは
405 - HTTP verb used to access this page is not allowed.
The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.
"NetworkError: 405 Method Not Allowed
どうすれば修正できますか