PUT + DELETE Http Verbs Returning 401/405 from the API on a Web Hosting Server

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>

.

, , ( !)

+3
3

: http://forums.iis.net/t/1163441.aspx

WebDAV PUT DELETE Verbs . , -.

+1

. : <handlers>, WebDAV, 401.3 .

:

<system.web>
    <compilation debug="true" targetFramework="4.0" />
    <authentication mode="Forms" />
</system.web>
0

For me it was something else. I needed to go to the site folder, open the security tab for the folder, click the "Change" button to change access rights to groups or user names, find the site from my IIS 8 sites and give it full control permission.

0
source

All Articles