WepApi HTTP Error 405.0 - Method Not Allowed

Hi Friends,
 
I am Exploring WebApi now a days . Today i confronted an error "The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used" whenever i execute a delete operation .
GET,POST operations were executing smoothly though i was only getting an error for DELETE operation in WebApi.

After struggling for an hour i found a solution for this .
 
Solution: We require to add a entry point for VERB "DELETE" into the applicationHost configuration file. exist at %userprofile%\documents\IISExpress\config folder.
Open the given file and find a value "ExtensionlessUrl-Integrated-4.0" , Now add PUT and DELETE  into "verb" parameter  as i have added and marked highlighted in yellow.
 
 
<add name="ExtensionlessUrl-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,DELETE,PUT" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" responseBufferLimit="0" />
 
WebApi has started working  anticipated.
 
Enjoy WebApi benefits. 
Ebook Download
View all
Learn
View all