I have an application in which I am using OData and Knockout Js. In my application I am using POST, GET and DELETE HTTP Verb and when I hosted my application, the GET and POST doesn't throw any error but DELETE does throw an error, not sure how to fix it.
Following is where I am using 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'
});
}
}
And the error is
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
How do I fix it