I went through every article I can find on SO and more. I made changes Web.configto the answer, since all of them seem to indicate the removal of the module and the handler WebDAV.
However, I still get the error:
405 Method not allowed
The requested resource does not support the http 'PUT' method.
NOTE: this was originally only an MVC 4 project. I added artifacts to support the web API. Looks like maybe I missed something.
NOTE. calls GETwork fine with Angular.
Web API Route Configuration
configuration.Routes.MapHttpRoute(
name: "Default API",
routeTemplate: "api/{controller}/{id}",
defaults: new { action = "Get", id = RouteParameter.Optional },
constraints: new { id = @"[\da-z-]{36}" });
configuration.Routes.MapHttpRoute(
name: "Default API with Action",
routeTemplate: "api/{controller}/{action}",
defaults: new { action = "Get" });
var formatter = GlobalConfiguration.Configuration.Formatters.JsonFormatter;
formatter.SerializerSettings.ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver();
Web.config
<modules runAllManagedModulesForAllRequests="true">
<remove name="WebDAVModule" />
</modules>
<handlers accessPolicy="Read, Execute, Script">
<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" />
</handlers>
PUT API input
public async Task<IHttpActionResult> Put([FromBody] EditUserViewModel viewModel)
Client side
vm.model.$update(function () {
$state.go(userStates.app);
});
Is it possible that he falls into the second configuration of the route? If so, how can I check which .NET route configuration is trying to use?