Web API on IIS 8.0 – 405 Method Not Allowed for PUT

Lately I’m extensively developing my web services in ASP.Net Web API and generally speaking it’s good framework in supporting HTTP programming (REST “style”), even if it is in it’s early stages and needed more features to be “completed”.

Yesterday I had a very interesting problem when I published new version of my project (btw, I am developing web api in ASP.Net 4.5 and deploy it in Windows Server 2012 and IIS 8).

When I hit my web api with a PUT request (PUT -> api.mydomain.com/profilecontroller/) web server’s response was error 405 (or method not allowed) while in same time my controller supported all types of requests (get, post, put, delete).

I was surprised with this error while just few minutes earlier everything worked perfectly.

I googled for some time and get disappointed with results – no solution found.

Started to think what I did with my web server and I remembered some “not friendly” touches 😀 in Web Server (IIS) Role configuration, like installing “WebDAV Publishing”.

I immediately uninstalled (unchecked) that “feature (not Windows Feature :D)” in Web Server (IIS) Role and everything started to work like a charm :D.

IIS Role WebDav

It was kind of a stupid solution (I have to admit) but finally everything worked fine :D.

 

Advertisements

About betim

An experienced SOA and Mobile software architect with a decade experience in building small-to-medium and large systems for public and private sector.
This entry was posted in ASP.NET, Development, IIS, Microsoft, WebAPI and tagged , , , , , , . Bookmark the permalink.

7 Responses to Web API on IIS 8.0 – 405 Method Not Allowed for PUT

  1. Andrejs says:

    Thank you. Worked as charm!

  2. joelbugarini says:

    It worked to me, bless you!

  3. SEO says:

    great post, very informative. I ponder why the opposite specialists of this sector do not understand this.
    You should proceed your writing. I’m sure, you’ve a great readers’ base already!

  4. Santosh Aher says:

    Boom !!!!!!!!!!
    It worked for me too !!!
    Thanks a lot …..

  5. Animesh says:

    Thanks Its working…

  6. berndv says:

    Thanks a lot for sharing!! This works Perfect!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s