Click here to Skip to main content
15,887,322 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
If I create a controller action and do not decorate it with AcceptVerbs, HttpPost or HttpGet. What is the default behaviour?

What I have tried:

Does the action allow any access method or does it default to GET?
Posted
Updated 16-Feb-19 22:46pm

1 solution

The place to start with questions like this is - naturally enough - Google.

A very quick search using your subject line as the question gave over thirteen thousand hits: What is the default behaviour of a controller action not marked with acceptverbs, httpget or httppost? - Google Search[^]
These included the exact same question posted on Stack Overflow in 2011 as the top result!

In future, please try to do at least basic research on your own, and not waste your time or ours.
 
Share this answer
 
Comments
Member 14119435 17-Feb-19 4:23am    
i did it before i asked it here,but i found 2 different answer.
in Stack Overflow answer is :
It's accessible via any verb.
On the other i found in tutorialsteacher's site this:
If you do not apply any attribute then it considers it a GET request by default.

i asked here because i want to find your answers and see what is the correct answer and find my mistake to understand this Concept.

I have great respect for MY TIME and YOUR TIME DEAR.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900