In the cross-domain interface call, write a handler, after the local deployment of the test is available, but for external links to call back when the 405 method not allowed, the workaround is as follows:
<system.webServer><remove name= "WebDAV"/> <remove name= "extensionlessurlhandler-isapi-4.0_32bit"/> <remove name= " Extensionlessurlhandler-isapi-4.0_64bit "/> <remove name=" extensionlessurlhandler-integrated-4.0 "/> < Add Name= "Extensionlessurlhandler-isapi-4.0_32bit" path= "*." verb= "Get,head,post,debug,put,delete,patch,options" Modules= "Isapimodule" scriptprocessor= "%windir%\microsoft.net\framework\v4.0.30319\aspnet_isapi.dll" precondition= "Classicmode,runtimeversionv4.0,bitness32" responsebufferlimit= "0"/> <add name= " Extensionlessurlhandler-isapi-4.0_64bit "path=" *. "verb=" get,head,post,debug,put,delete,patch,options "modules=" Isapimodule "scriptprocessor="%windir%\microsoft.net\framework64\v4.0.30319\aspnet_isapi.dll "preCondition=" Classicmode,runtimeversionv4.0,bitness64 "responsebufferlimit=" 0 "/> <add name=" extensionlessurlhandler-integrated-4.0 "path=" *. "verb=" get,head,post,debug,put,delete,patch,options "type=" System.Web.Handlers.TransferRequestHandler "PRecondition= "integratedmode,runtimeversionv4.0"/>
<add name= "handler" path= "Handler.ashx" verb= "*" type= "Webapp.handler"/> <remove name= "Optionsverbhandler"/><modules runallmanagedmodulesforallrequests= "true" > <remove name= "webdavmodule"/> </modules> </system.webServer>
Attention:
In the above configuration, the cyan part is a cross-domain problem , the red part is to solve the 405 error,
In particular, note the bold section , add the corresponding handler file, and the following type is "namespace. Class name", as
Namespace WebApp
{
<summary>
Summary description of Handler
</summary>
public class Handler:ihttphandler
{
...
}
External call C # Generic Handler returns 405 method not allowed workaround