In MVC 3, is it possible to determine if an action is a result of a POST or GET method? I know you can decorate the actions with [HttpPost] and [HttpGet] to fire a specific
If you're like me and prefer not to use a string literal (.net core 2.2 middleware using DI):
public async Task InvokeAsync(HttpContext context) { if (context.Request.Method.Equals(HttpMethods.Get, StringComparison.OrdinalIgnoreCase)) { … } }