IIS 7 and Above
HTTP Error - 405.0 Method Not Allowed
Last post Feb 16, 2021 06:45 AM by Brucz
Feb 15, 2021 06:33 PM|Renjuz|LINK
I am creating a website that runs on Angular 10 as frontend and enitity web API as backend. Many of my Angular pages push information to the next page via "POST". When submitting information from a Angular form using "POST" I receive the following error:
I have tried changing the web.config file and adding/removing various handlers and modules , but it did not fix the issue.
What do I need to do to resolve this error?
Feb 16, 2021 06:45 AM|Brucz|LINK
problem occurs may because two reasons. Client makes a request by using an HTTP method but doesn't comply with the HTTP specifications and the post request is handled by Static File handler. I think your reason is second one because request page is
Whatever IIS or other server, by default the web server doesn't allow POST verb on .html page. So you can change the handler so that this request will not be handled by StaticFile. For example change .html page to .asp or .aspx page. Request will be handled
Another solution is changing POST request to GET request so that StaticFile handler can handle it.