Any ASP.NET WebAPI2 ApiController
method names that do NOT begin with a configured METHOD prefix (by default Get...
, Post...
, Put...
, Delete...
, Head...
, Options...
, and Patch...
) will match an HTTP 'POST'. (See Is there a default verb applied to a Web API ApiController method? for details.)
I would rather have to opt-in for every method, by convention, than opt-out.
To me, the opt-out approach represents a greater security risk, and has no helpful payoff; for consistency, to support POST the implementer should prefix the class method Post...
regardless. For example, an ApiController
method named SensitiveFunction() shouldn't match any HTTP METHOD unless I intentionally configure support for a 'SENSITIVE' HTTP METHOD.
Is there a simple configuration change that will allow me to disable this POST fallback policy?
Alternately, am I overlooking some reason I would need this fallback policy?