The Web. config add configuration is as follows:
<system.webserver> <!--the following configuration in order for iis7+ to support the Put/delete method - <Httpprotocol> <customheaders> <Addname= "Access-control-allow-origin"value="*" /> <Addname= "Access-control-allow-methods"value= "Get,put,post,delete,options" /> <Addname= "Access-control-allow-headers"value= "Content-type" /> </customheaders> </Httpprotocol><!--This configuration must be added on the iis7/7.5, otherwise access error - <Modulesrunallmanagedmodulesforallrequests= "true"> <Removename= "Webdavmodule" /> </Modules> <Validationvalidateintegratedmodeconfiguration= "false" /> <handlers> <Removename= "WebDAV" /> <Removename= "Extensionlessurlhandler-isapi-4.0_32bit" /> <Removename= "Extensionlessurlhandler-isapi-4.0_64bit" /> <Removename= "extensionlessurlhandler-integrated-4.0" /> <Addname= "Extensionlessurlhandler-isapi-4.0_32bit"Path="*."verb= "Get,head,post,debug,put,delete,patch,options"ResourceType= "Unspecified"requireaccess= "Script"Modules= "Isapimodule"ScriptProcessor= "%windir%\microsoft.net\framework\v4.0.30319\aspnet_isapi.dll"Precondition= "Classicmode,runtimeversionv4.0,bitness32"Responsebufferlimit= "0" /> <Addname= "Extensionlessurlhandler-isapi-4.0_64bit"Path="*."verb= "Get,head,post,debug,put,delete,patch,options"ResourceType= "Unspecified"requireaccess= "Script"Modules= "Isapimodule"ScriptProcessor= "%windir%\microsoft.net\framework64\v4.0.30319\aspnet_isapi.dll"Precondition= "Classicmode,runtimeversionv4.0,bitness64"Responsebufferlimit= "0" /> <Addname= "extensionlessurlhandler-integrated-4.0"Path="*."verb= "Get,head,post,debug,put,delete,patch,options"ResourceType= "Unspecified"requireaccess= "Script"type= "System.Web.Handlers.TransferRequestHandler"Precondition= "integratedmode,runtimeversionv4.0" /> </handlers><!--increase the Get URL length limit cap - <Security> <requestfiltering> <requestlimitsMaxUrl= "409600"maxquerystring= "204800" /> </requestfiltering> </Security></system.webserver>
The ASP. NET MVC 5 WEB API enables the Put method