C# 判断当前请求是GET、还是POST ?

方法一:

 HttpContext.Current.Request.RequestType == "POST"   //当前请求为:POST 

 方法二:

if(Request.ServerVariables["REQUEST_METHOD"] =="POST")

 

posted @ 2019-06-15 08:55  咖啡无眠  阅读(1881)  评论(0编辑  收藏  举报