webapi 中使用request form

 
 HttpContextBase context = (HttpContextBase)Request.Properties["MS_HttpContext"];//获取传统context

 HttpRequestBase request = context.Request;//定义传统request对象

 string a = request.Form["Key"];

 

 var token = HttpContext.Current.Request.Headers["Key"];

 

 

  var token = HttpContext.Current.Request.Headers["token"];
  var uid = HttpContext.Current.Request.Form["uid"];
  var aa = HttpContext.Current.Request.Form["list[aa]"];
posted @ 2020-11-04 10:04  阿鹏哥  阅读(434)  评论(0编辑  收藏  举报