4

Maybe I cannot find manual.

I found experimentally that POST is default acceptance verb if a method does not follow webapi naming convension (Post~~, Get~~) and does not describe verb attribute like [HttpPost] in webapi.

is that right? is there any description about this?

Youngjae
  • 24,352
  • 18
  • 113
  • 198
  • oh downvoter, why... – Youngjae Nov 10 '14 at 01:32
  • possible duplicate of [Is there a default verb applied to a Web API ApiController method?](http://stackoverflow.com/questions/23686841/is-there-a-default-verb-applied-to-a-web-api-apicontroller-method) – Youngjae Nov 10 '14 at 01:56
  • 1
    Upvoted. 1) google found yours because the title matched my natural search, 2) rather than downvote should have been a duplicate close vote. – shannon Apr 13 '15 at 13:30
  • p.s. I was glad to have a quick confirmation of this. The fact that I couldn't find it in documentation even *after* suspecting it was happening underscores the security risk this represents. I had put a public method on my ApiController base class to assist in instrumenting a code management task. – shannon Apr 13 '15 at 13:34

1 Answers1

6

That's correct. If the method name doesn't map (through attribute, or convention) to a supported HTTP verb, then the default is POST.

Refer to the answer there

Is there a default verb applied to a Web API ApiController method?

Community
  • 1
  • 1
Julien Jacobs
  • 2,561
  • 1
  • 24
  • 34
  • Did you mean to link to another question? Your link isn't very helpful at the moment because it actually points to this question. – Luke Woodward Nov 09 '14 at 20:33