How can you define a route in ASP.NET Core to be available only for specific HTTP methods using attribute routing?

  • [HttpPut], [HttpPost]
  • [HttpGet], [HttpPost]
  • [HttpDelete], [HttpGet]
  • [HttpPatch], [HttpPut]
In ASP.NET Core, you can specify the HTTP methods a route should be available for using attributes like [HttpGet] or [HttpPost] above the controller action method. For example, [HttpGet] ensures the route is available for HTTP GET requests, and [HttpPost] for HTTP POST requests.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *