C#判断当前页面是否接收到了Post请求

C#判断当前页面是否接收到了Get请求

        /// <summary>
        /// 判断当前页面是否接收到了Post请求
        /// </summary>
        /// <returns>是否接收到了Post请求</returns>
        public static bool IsPost()
        {
            return HttpContext.Current.Request.HttpMethod.Equals("POST");
        }
        /// <summary>
        /// 判断当前页面是否接收到了Get请求
        /// </summary>
        /// <returns>是否接收到了Get请求</returns>
        public static bool IsGet()
        {
            return HttpContext.Current.Request.HttpMethod.Equals("GET");
        }
        /// 当前页面请求类型
        ///public static string GetHttpMethod()
        {
            return HttpContext.Current.Request.HttpMethod;
        }


原文链接:判断当前页面是否接收到了Get或者Post请求