确定ajax请求是否为ASP.NET MVC3中的POST或GET类型

bur*_*fon 1 asp.net asp.net-mvc-3

出于异常处理的目的,我想知道是否使用POST或GET进行了ajax请求,但无法找到如何执行此操作.

我到目前为止:

var request = filterContext.RequestContext.HttpContext.Request.GetType();
Run Code Online (Sandbox Code Playgroud)

我在正确的轨道上吗?

sha*_*esh 5

查看RequestType属性以确定它是GET还是POST.

Request.RequestType