Questions tagged [acceptverbs]

acceptverbs represents an attribute that specifies which HTTP verbs an action method will respond to

AcceptVerbsAttribute(String[]) :- Initializes a new instance of the AcceptVerbsAttribute class by using a list of HTTP verbs that the action method will respond to.

AcceptVerbsAttribute(HttpVerbs) :- Initializes a new instance of the AcceptVerbsAttribute class using the HTTP verbs that the action method will respond to.

9 questions
41
votes
2 answers

Respond to HTTP HEAD requests using ASP.NET MVC

I'd like to correctly support the HTTP HEAD request when bots hit my ASP.NET MVC site using HEAD. It was brought to my attention that all HTTP HEAD requests to the site were returning 404s, particularly from http://downforeveryoneorjustme.com. Which…
DavGarcia
  • 18,540
  • 14
  • 58
  • 96
21
votes
3 answers

ASP.NET MVC AcceptVerbs and registering routes

do I have to register the HttpVerb constraint in my route definition (when i'm registering routes) if i have decorated my action method with the [AcceptVerbs(..)] attribute already? eg. i have this. [AcceptVerbs(HttpVerbs.Post)] public ActionResult…
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
11
votes
2 answers

What is the default behaviour of a controller action not marked with AcceptVerbs, HttpGet or HttpPost?

If I create a controller action and do not decorate it with AcceptVerbs, HttpPost or HttpGet. What is the default behaviour? Does the action allow any access method or does it default to GET?
John Mills
  • 10,020
  • 12
  • 74
  • 121
3
votes
4 answers

Testing MVC Controller Action HttpAcceptAttribute Verbs

What is the best way to unit test the controller action HttpAcceptAttribute verbs? So far I have the following but it's so ugly even a mother couldn't love it and not very flexible. Is there a better way? [Fact] // using xUnit, mocking controller in…
2
votes
2 answers

Asp.net MVC AcceptVerbs

Here the RedirectToAction() doesn't call the ActionResult Index. Do I need to register a route for this? [ActionName("onchange")] [AcceptVerbs(HttpVerbs.Post)] public ActionResult OnChange(int i) { m_NumberOfVisibleItems = i; …
Paresh
1
vote
1 answer

What are Accept verbs in asp.net mvc?

While referring asp.net mvc I got stuck on Accept verbs. I know Accept verbs are used for polymorphism in mvc but how do they work ? I think there are 7 Accept verbs in…
user4863034
1
vote
1 answer

REST based web chat in java and eclipse

I want to create a REST based chat application in Java using Eclipse, but I have no idea how to start. How do I take care of resources, verbs, and HEATOS.
Mavrick
  • 505
  • 1
  • 7
  • 27
0
votes
1 answer

Correct HTTP verb for updating cache for REST Api

I am developing RESTful Api micro service which is cache all data in memory (and update it every n minutes from persistent storage). Service has an api for immediate cache updating /update-cache. What is best http verb for updating cache? GET, POST,…
Dmitriy O.
  • 63
  • 6
0
votes
1 answer

Asp.net MVC Post JSon data from one to another?

I have Three projects in one solution (two are asp.net MVC type and last one is class type); call it EmployeeMVC Proj and TimeSheetMVC Proj (To manage the views) and Third one EntityLib proj. Now from EmployeeMVC Proj; I would like to pup-up a page…
Jigar Pandya
  • 6,004
  • 2
  • 27
  • 45