In .NET Core 7 Web API, which utilizes Entity Framework, I encountered an error when making HTTP PUT and DELETE requests on the server. However, the code works correctly when running locally.
The specific error received is "405 - HTTP verb used to access this page is not allowed."
APIs:
[HttpDelete]
[Route("DeleteCode")]
[Authorize]
public ActionResult DeleteCode(int Id)
{
}
and
[Route("EditCode")]
[HttpPut]
[Authorize]
public ActionResult EditCode(CodeDTO model)
{
}
Please note that my database is hosted on Plesk.
I tried adding the suggested code to the server's webconfig file, but unfortunately, it did not resolve the issue.
<system.webServer>
<modules>
<remove name="WebDAVModule" />
</modules>
<handlers>
<remove name="WebDAV" />
</handlers>
</system.webServer>