CMircea
CMircea

Reputation: 3568

Restrict attribute routes to specific HTTP verbs

With the AttributeRouting library I can restrict a route to a specific verb:

[Route("customers", HttpVerbs.Post)]

In MVC 5 AttributeRouting is built in, but there is no overload taking HttpVerbs. How do I restrict a route to POST in this case?

Upvotes: 5

Views: 794

Answers (1)

jd4u
jd4u

Reputation: 5807

You can specify the [HttpGet()], [HttpPost()], [HttpPut()] to restrict the method to one or more supported Http method,

Upvotes: 1

Related Questions