On my edit page, I am using an api controller.
Here is my $.ajax:
var settings = {};
settings.baseUri = '@Request.ApplicationPath';
var infoGetUrl = "";
if (settings.baseUri === "/ServerProjectName") {
infoGetUrl = settings.baseUri + "/api/controllerName/";
} else {
infoGetUrl = settings.baseUri + "api/controllerName/";
}
$("#Edit-Btn").on("click",
function(e) {
$("form").validate({
submitHandler: function() {
e.preventDefault();
$.ajax({
method: "PUT",
url: infoGetUrl,
data: $("form").serialize(),
success: function(data) {
toastr.options = {
onHidden: function() {
window.location.href = newUrl;
},
timeOut: 3000
}
toastr.success("Successfully edited.");
},
error: function (jqXHR, textStatus, errorThrown) {
var status = capitalizeFirstLetter(textStatus);
toastr.error(status + " - " + jqXHR.responseText);
}
});
}
});
});
Below this method is another ajax function for 'DELETE' and that works perfectly. Only PUT methods are giving me this error.
When I submit, I receive an error saying:
The requested resource does not support http method 'PUT'
I have looked at this but not quite understanding. I am using IE 11, so I think it should be supported.
Any ideas or help is greatly appreciated.