I created MVC Web Api for some kind of university term paper that works, as expected, on my development machine (Running VS11).
However, when I deploy the application to a web server on 123reg, HttpVerbs, except for GET and POST, does not seem to reach my application at all, initially 401 Unauthorized response was returned; however, after disabling the WebDAV module, as suggested here , these 401s became 405 Method not allowed. In this case, I turned off the handlers only as disabling both handlers, and the module meant that my application did not start at all (error 500 without stacktrace [user errors disabled]).
I plan on using the membership provider of forms to add authentication capabilities to my API, however, I removed all the attributes [Authorise]from my code when 401 began to appear.
Applications on shared hosting 123Reg run under average trust.
I was in contact with 123Reg support, and they were semi-useful, but since then they decided that they cannot help me further (they suggested adding HttpHandlers, as described in detail below) (Apparently, I should consult with a web designer ...)
Things I tried:
I added attributes [AllowAnonymous]to my controllers and / or actions without effect.
I added the authorizationweb.config attribute , which allows all verbs and paths for all users to authenticate, rather than:
<authorization>
<allow users="*" />
<allow users="?" />
<allow verbs="*" users="*" />
<allow verbs="*" users="?" />
</authorization>
I added (as suggested by 123Reg):
<system.webServer>
<handlers>
<remove name="WebDAV" />
<add name="PUTVerbHandler" path="*" verb="PUT" modules="ProtocolSupportModule" resourceType="Unspecified" />
<add name="DELETEVerbHandler" path="*" verb="DELETE" modules="ProtocolSupportModule" resourceType="Unspecified" />
</handlers>
</system.webServer>
, 405 , 401 respones, . , :
<httpHandlers>
<add verb="*" path="*" type="System.Web.Mvc.MvcHttpHandler"/>
</httpHandlers>
.
, , ( !)